1 /* { dg-do compile } */
2 /* { dg-options "-O2 -w" } */
3 
4 /* This file was automatically reduced from tree-ssa-operands.c.  It
5    contains many warnings, but it exposes a copy propagation bug that
6    is somewhat difficult to reproduce otherwise.  */
7 
8 __extension__ typedef __SIZE_TYPE__ size_t;
9   extern void fancy_abort (const char *, int, const char *) __attribute__ ((__noreturn__));
10   typedef union tree_node *tree;
11   enum tree_code {
12  TREE_LIST, ARRAY_TYPE, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE, STRING_CST, LT_EXPR, GE_EXPR, LABEL_EXPR, ASM_EXPR, SSA_NAME, };
13   enum tree_code_class {
14    tcc_type,   tcc_reference,   tcc_expression };
15   extern const enum tree_code_class tree_code_type[];
16   extern const unsigned char tree_code_length[];
17   struct tree_common {
18    union tree_ann_d *ann;
19    __extension__ enum tree_code code : 8;
20  };
21   struct tree_string {
22    char str[1];
23  };
24   struct tree_list {
25    tree purpose;
26    tree value;
27  };
28   struct tree_exp {
29    tree     operands[1];
30  };
31   typedef struct ssa_use_operand_d {
32    struct ssa_use_operand_d* prev;
33    struct ssa_use_operand_d* next;
34    tree stmt;
35    tree * use;
36  }
37   ssa_use_operand_t;
38   struct tree_ssa_name {
39    struct ssa_use_operand_d imm_uses;
40  };
41   union tree_node {
42    struct tree_common common;
43    struct tree_string string;
44    struct tree_list list;
45    struct tree_exp exp;
46    struct tree_ssa_name ssa_name;
47  };
48   typedef struct bitmap_head_def *bitmap;
49   typedef union varray_data_tag {
50    char c[1];
51    int i[1];
52    tree * tp[1];
53  }
54   varray_data;
55   struct varray_head_tag {
56    size_t num_elements;
57    size_t elements_used;
58    varray_data data;
59  };
60   typedef struct varray_head_tag *varray_type;
61   extern void varray_check_failed (varray_type, size_t, const char *, int,      const char *) __attribute__ ((__noreturn__));
62   typedef ssa_use_operand_t *use_operand_p;
63   struct use_optype_d {
64    struct use_optype_d *next;
65    struct ssa_use_operand_d use_ptr;
66  };
67   typedef struct use_optype_d *use_optype_p;
68   struct ssa_operand_memory_d {
69    char mem[(2048 - sizeof (void *))];
70  };
71   struct stmt_operands_d {
72    struct use_optype_d * use_ops;
73  };
74   struct ptr_info_def {
75    tree name_mem_tag;
76  };
77   typedef struct subvar *subvar_t;
78   struct var_ann_d {
79    size_t uid;
80  };
81   struct stmt_ann_d {
82    unsigned modified : 1;
83    struct stmt_operands_d operands;
84    bitmap addresses_taken;
85  };
86   typedef struct var_ann_d *var_ann_t;
87   typedef struct stmt_ann_d *stmt_ann_t;
var_ann(tree t)88   static __inline__ var_ann_t var_ann (tree t) {
89  }
stmt_ann(tree t)90   static __inline__ stmt_ann_t stmt_ann (tree t) {
91    ((void)(!(is_gimple_stmt (t)) ? fancy_abort ("/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-flow-inline.h", 55, __FUNCTION__), 0 : 0));
92    return (stmt_ann_t) t->common.ann;
93  }
stmt_modified_p(tree t)94   static __inline__ unsigned char stmt_modified_p (tree t) {
95    stmt_ann_t ann = stmt_ann (t);
96    return ann ? ann->modified : 1;
97  }
delink_imm_use(ssa_use_operand_t * linknode)98   static __inline__ void delink_imm_use (ssa_use_operand_t *linknode) {
99    if (linknode->prev == ((void *)0))     return;
100    linknode->prev->next = linknode->next;
101    linknode->next->prev = linknode->prev;
102    linknode->prev = ((void *)0);
103    linknode->next = ((void *)0);
104  }
link_imm_use_to_list(ssa_use_operand_t * linknode,ssa_use_operand_t * list)105   static __inline__ void link_imm_use_to_list (ssa_use_operand_t *linknode, ssa_use_operand_t *list) {
106    linknode->prev = list;
107    linknode->next = list->next;
108    list->next = linknode;
109  }
link_imm_use(ssa_use_operand_t * linknode,tree def)110   static __inline__ void link_imm_use (ssa_use_operand_t *linknode, tree def) {
111    ssa_use_operand_t *root;
112    if (!def || ((enum tree_code) (def)->common.code) != SSA_NAME)     linknode->prev = ((void *)0);
113    else     {
114        root = &(__extension__ ({ const tree __t = (def); if (((enum tree_code) (__t)->common.code) != (SSA_NAME)) tree_check_failed (__t, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-flow-inline.h", 222, __FUNCTION__, (SSA_NAME), 0); __t; }
115 )->ssa_name.imm_uses);
116        link_imm_use_to_list (linknode, root);
117      }
118  }
link_imm_use_stmt(ssa_use_operand_t * linknode,tree def,tree stmt)119   static __inline__ void link_imm_use_stmt (ssa_use_operand_t *linknode, tree def, tree stmt) {
120      link_imm_use (linknode, def);
121  }
122   struct ggc_root_tab {
123  };
124   struct opbuild_list_d {
125    varray_type vars;
126    varray_type uid;
127    varray_type next;
128    int first;
129    unsigned num;
130  };
131   static struct opbuild_list_d build_uses;
132   static struct opbuild_list_d build_v_may_defs;
133   static struct ssa_operand_memory_d *operand_memory = ((void *)0);
134   static unsigned operand_memory_index;
135   static use_optype_p free_uses = ((void *)0);
opbuild_next(struct opbuild_list_d * list,int prev)136   static __inline__ int opbuild_next (struct opbuild_list_d *list, int prev) {
137    return __extension__ (*({
138  varray_type const _va = (list->next);
139  const size_t _n = (prev);
140  if (_n >= _va->num_elements) varray_check_failed (_va, _n, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 323, __FUNCTION__);
141  &_va->data.i[_n];
142  }
143 ));
144  }
opbuild_elem_real(struct opbuild_list_d * list,int elem)145   static __inline__ tree * opbuild_elem_real (struct opbuild_list_d *list, int elem) {
146    return __extension__ (*({
147  varray_type const _va = (list->vars);
148  const size_t _n = (elem);
149  if (_n >= _va->num_elements) varray_check_failed (_va, _n, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 332, __FUNCTION__);
150  &_va->data.tp[_n];
151  }
152 ));
153  }
opbuild_clear(struct opbuild_list_d * list)154   static __inline__ void opbuild_clear (struct opbuild_list_d *list) {
155    ((list->vars)->elements_used = 0);
156    ((list->next)->elements_used = 0);
157  }
ssa_operand_alloc(unsigned size)158   static __inline__ void * ssa_operand_alloc (unsigned size) {
159    char *ptr;
160    if (operand_memory_index + size >= (2048 - sizeof (void *)))     {
161        ptr = ggc_alloc_stat (sizeof (struct ssa_operand_memory_d) );
162      }
163    ptr = &(operand_memory->mem[operand_memory_index]);
164    return ptr;
165  }
correct_use_link(use_operand_p ptr,tree stmt)166   static __inline__ void correct_use_link (use_operand_p ptr, tree stmt) {
167    use_operand_p prev;
168    tree root;
169    prev = ptr->prev;
170    if (prev)     {
171        unsigned char stmt_mod = 1;
172        while (stmt_mod)  {    while (prev->stmt == stmt || prev->stmt == ((void *)0))      prev = prev->prev;    if (prev->use == ((void *)0))      stmt_mod = 0;    else      if ((stmt_mod = stmt_modified_p (prev->stmt)))        prev = prev->prev;  }
173        if (prev->use == ((void *)0))  root = prev->stmt;
174        else  root = *(prev->use);
175        if (root == *(ptr->use))  return;
176      }
177    delink_imm_use (ptr);
178    link_imm_use (ptr, *(ptr->use));
179  }
alloc_use(void)180   static __inline__ struct use_optype_d * alloc_use (void) {
181    struct use_optype_d *ret;
182      {
183        free_uses = free_uses->next;
184      }
185      ret = (struct use_optype_d *)ssa_operand_alloc (sizeof (struct use_optype_d));
186    return ret;
187  }
finalize_ssa_use_ops(tree stmt)188   static __inline__ void finalize_ssa_use_ops (tree stmt) {
189    int new_i;
190    struct use_optype_d *old_ops, *ptr, *last;
191    tree * old_base;
192    struct use_optype_d new_list;
193    last = &new_list;
194    if (old_ops)     old_base = ((old_ops)->use_ptr.use);
195    while (old_ops && new_i != -1)     {
196        tree * new_base = opbuild_elem_real (&build_uses, (new_i));
197        if (old_base == new_base)         {    last->next = old_ops;    last = old_ops;    correct_use_link ((&((last)->use_ptr)), stmt);    old_ops = old_ops->next;    new_i = opbuild_next (&build_uses, new_i);  }
198        else         if (old_base < new_base)    {      use_operand_p use_p = (&((old_ops)->use_ptr));      delink_imm_use (use_p);      old_ops = old_ops->next;      ptr->next = free_uses;    }
199   else    {      ptr = alloc_use ();      (ptr)->use_ptr.use = (opbuild_elem_real (&build_uses, (new_i))); link_imm_use_stmt (&((ptr)->use_ptr), *(opbuild_elem_real (&build_uses, (new_i))), (stmt));      new_i = opbuild_next (&build_uses, new_i);    }
200        if (old_ops)         old_base = ((old_ops)->use_ptr.use);
201      }
202    for ( ;
203   new_i != -1;
204   new_i = opbuild_next (&build_uses, new_i))     {
205        ptr = alloc_use ();
206        (ptr)->use_ptr.use = (opbuild_elem_real (&build_uses, (new_i)));
207  link_imm_use_stmt (&((ptr)->use_ptr), *(opbuild_elem_real (&build_uses, (new_i))), (stmt));
208      }
209      {
210   {    use_operand_p use_p = (&((ptr)->use_ptr));    delink_imm_use (use_p);  }
211      }
212    (stmt_ann (stmt)->operands.use_ops) = new_list.next;
213    {
214      unsigned x = 0;
215      for (ptr = (stmt_ann (stmt)->operands.use_ops);
216  ptr;
217  ptr = ptr->next)       x++;
218    }
219  }
finalize_ssa_uses(tree stmt)220   finalize_ssa_uses (tree stmt) {
221    {
222      unsigned x;
223        ((void)(!(*(opbuild_elem_real (&build_uses, x)) != stmt) ? fancy_abort ("/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 581, __FUNCTION__), 0 : 0));
224    }
225    finalize_ssa_use_ops (stmt);
226    opbuild_clear (&build_uses);
227  }
finalize_ssa_v_may_def_ops(tree stmt)228   finalize_ssa_v_may_def_ops (tree stmt) {
229    int new_i;
230      {
231      }
232    for ( ;
233   new_i != -1;
234   new_i = opbuild_next (&build_v_may_defs, new_i))     {
235      }
236    {
237    }
238  }
get_expr_operands(tree stmt,tree * expr_p,int flags)239   get_expr_operands (tree stmt, tree *expr_p, int flags) {
240    enum tree_code code;
241    tree expr = *expr_p;
242      {
243        {  subvar_t svars;  if (var_can_have_subvars (expr)      && (svars = get_subvars_for_var (expr)))    {    }    {    }       }
244        {    {      if (code == LT_EXPR   || code == GE_EXPR)        {   swap_tree_operands (stmt,         &__extension__ (*({const tree __t = __extension__ ({ const tree __t = (expr); char const __c = tree_code_type[(int) (((enum tree_code) (__t)->common.code))]; if (!((__c) >= tcc_reference && (__c) <= tcc_expression)) tree_class_check_failed (__t, tcc_expression, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1435, __FUNCTION__); __t; }); const int __i = (0); if (__i < 0 || __i >= tree_code_length[(int) (((enum tree_code) (__t)->common.code))]) tree_operand_check_failed (__i, ((enum tree_code) (__t)->common.code), "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1435, __FUNCTION__); &__t->exp.operands[__i]; })),         &__extension__ (*({const tree __t = __extension__ ({ const tree __t = (expr); char const __c = tree_code_type[(int) (((enum tree_code) (__t)->common.code))]; if (!((__c) >= tcc_reference && (__c) <= tcc_expression)) tree_class_check_failed (__t, tcc_expression, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1436, __FUNCTION__); __t; }); const int __i = (1); if (__i < 0 || __i >= tree_code_length[(int) (((enum tree_code) (__t)->common.code))]) tree_operand_check_failed (__i, ((enum tree_code) (__t)->common.code), "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1436, __FUNCTION__); &__t->exp.operands[__i]; })));        }        {        }    }       }
245      }
246  }
get_asm_expr_operands(tree stmt)247   get_asm_expr_operands (tree stmt) {
248    int noutputs = list_length (__extension__ (*({
249 const tree __t = __extension__ ({ const tree __t = (__extension__ ({ const tree __t = (stmt); if (((enum tree_code) (__t)->common.code) != (ASM_EXPR)) tree_check_failed (__t, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1495, __FUNCTION__, (ASM_EXPR), 0); __t; })); char const __c = tree_code_type[(int) (((enum tree_code) (__t)->common.code))]; if (!((__c) >= tcc_reference && (__c) <= tcc_expression)) tree_class_check_failed (__t, tcc_expression, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1495, __FUNCTION__); __t; }
250 );
251  const int __i = (1);
252  if (__i < 0 || __i >= tree_code_length[(int) (((enum tree_code) (__t)->common.code))]) tree_operand_check_failed (__i, ((enum tree_code) (__t)->common.code), "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1495, __FUNCTION__);
253  &__t->exp.operands[__i];
254  }
255 )));
256    const char **oconstraints     = (const char **) __builtin_alloca((noutputs) * sizeof (const char *));
257    int i;
258    tree link;
259    const char *constraint;
260    unsigned char allows_mem, allows_reg, is_inout;
261      {
262        oconstraints[i] = constraint  = ((const char *)(__extension__ ({ const tree __t = ((__extension__ ({ const tree __t = ((__extension__ ({ const tree __t = (link); if (((enum tree_code) (__t)->common.code) != (TREE_LIST)) tree_check_failed (__t, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1506, __FUNCTION__, (TREE_LIST), 0); __t; })->list.purpose)); if (((enum tree_code) (__t)->common.code) != (TREE_LIST)) tree_check_failed (__t, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1506, __FUNCTION__, (TREE_LIST), 0); __t; })->list.value)); if (((enum tree_code) (__t)->common.code) != (STRING_CST)) tree_check_failed (__t, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1506, __FUNCTION__, (STRING_CST), 0); __t; }
263 )->string.str));
264        parse_output_constraint (&constraint, i, 0, 0,    &allows_mem, &allows_reg, &is_inout);
265        }
266  }
get_indirect_ref_operands(tree stmt,tree expr,int flags)267   get_indirect_ref_operands (tree stmt, tree expr, int flags) {
268    tree *pptr = &__extension__ (*({
269 const tree __t = __extension__ ({ const tree __t = (expr); char const __c = tree_code_type[(int) (((enum tree_code) (__t)->common.code))]; if (!((__c) >= tcc_reference && (__c) <= tcc_expression)) tree_class_check_failed (__t, tcc_expression, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1591, __FUNCTION__); __t; }
270 );
271  const int __i = (0);
272  if (__i < 0 || __i >= tree_code_length[(int) (((enum tree_code) (__t)->common.code))]) tree_operand_check_failed (__i, ((enum tree_code) (__t)->common.code), "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1591, __FUNCTION__);
273  &__t->exp.operands[__i];
274  }
275 ));
276    tree ptr = *pptr;
277      {
278        struct ptr_info_def *pi = ((void *)0);
279        if (((enum tree_code) (ptr)->common.code) == SSA_NAME    && pi->name_mem_tag)  {  }
280      }
281  }
note_addressable(tree var,stmt_ann_t s_ann)282   note_addressable (tree var, stmt_ann_t s_ann) {
283    subvar_t svars;
284      {
285        if (var_can_have_subvars (var)    && (svars = get_subvars_for_var (var)))  bitmap_set_bit (s_ann->addresses_taken, var_ann (var)->uid);
286      }
287  }
288   const struct ggc_root_tab gt_ggc_r_gt_tree_ssa_operands_h[] = {
289    {
290      &operand_memory,   }
291 ,   {
292    }
293 ,   {
294    }
295 ,   {
296    }
297 , };
298