| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-Wno-old-style-definition -O -fdump-tree-dce3" } */ |
| 3 |
|
| 4 |
struct rtx_def; |
| 5 |
typedef struct rtx_def *rtx; |
| 6 |
union tree_node; |
| 7 |
typedef union tree_node *tree; |
| 8 |
typedef struct mem_attrs |
| 9 |
{ |
| 10 |
int foo; |
| 11 |
|
| 12 |
} mem_attrs; |
| 13 |
union rtunion_def |
| 14 |
{ |
| 15 |
mem_attrs *rtmem; |
| 16 |
}; |
| 17 |
typedef union rtunion_def rtunion; |
| 18 |
struct rtx_def |
| 19 |
{ |
| 20 |
rtunion fld[1]; |
| 21 |
}; |
| 22 |
struct tree_decl |
| 23 |
{ |
| 24 |
rtx rtl; |
| 25 |
}; |
| 26 |
union tree_node |
| 27 |
{ |
| 28 |
struct tree_decl decl; |
| 29 |
}; |
| 30 |
int make_decl_rtl (tree, int); |
| 31 |
void * |
| 32 |
get_alias_set (t, t1) |
| 33 |
tree t; |
| 34 |
void *t1; |
| 35 |
{ |
| 36 |
long set; |
| 37 |
if (t->decl.rtl) |
| 38 |
return (t->decl.rtl->fld[1].rtmem |
| 39 |
? 0 |
| 40 |
: (((t->decl.rtl ? t->decl.rtl: (make_decl_rtl (t, 0), t->decl.rtl)))->fld[1]).rtmem); |
| 41 |
return t1; |
| 42 |
} |
| 43 |
|
| 44 |
/* There should be precisely one load of ->decl.rtl. If there is |
| 45 |
more than, then the dominator optimizations failed. */ |
| 46 |
/* { dg-final { scan-tree-dump-times "->decl\\.rtl" 1 "dce3"} } */ |
| 47 |
|
| 48 |
/* There should be no loads of .rtmem since the complex return statement |
| 49 |
is just "return 0". */ |
| 50 |
/* { dg-final { scan-tree-dump-times ".rtmem" 0 "dce3"} } */ |
| 51 |
|
| 52 |
/* There should be one IF statement (the complex return statement should |
| 53 |
collapse down to a simple return 0 without any conditionals). */ |
| 54 |
/* { dg-final { scan-tree-dump-times "if " 1 "dce3"} } */ |
| 55 |
|