| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-Wno-old-style-definition -O1 -fno-tree-fre -fdump-tree-dom2" } */ |
| 3 |
|
| 4 |
extern void abort (void); |
| 5 |
union tree_node; |
| 6 |
typedef union tree_node *tree; |
| 7 |
enum tree_code |
| 8 |
{ |
| 9 |
LAST_AND_UNUSED_TREE_CODE |
| 10 |
}; |
| 11 |
extern const char tree_code_type[]; |
| 12 |
struct tree_common |
| 13 |
{ |
| 14 |
enum tree_code code:8; |
| 15 |
}; |
| 16 |
struct tree_type |
| 17 |
{ |
| 18 |
struct tree_common common; |
| 19 |
double alias_set; |
| 20 |
}; |
| 21 |
union tree_node |
| 22 |
{ |
| 23 |
struct tree_common common; |
| 24 |
struct tree_type type; |
| 25 |
}; |
| 26 |
long |
| 27 |
foo (t, set) |
| 28 |
tree t; |
| 29 |
double set; |
| 30 |
{ |
| 31 |
if (tree_code_type[t->common.code] != 't') |
| 32 |
abort (); |
| 33 |
|
| 34 |
t->type.alias_set = set; |
| 35 |
|
| 36 |
if (t->common.code == 42) |
| 37 |
return 1; |
| 38 |
else |
| 39 |
return 0; |
| 40 |
} |
| 41 |
/* There should be precisely one load of common.code. If there is |
| 42 |
more than one, then the dominator optimizations failed. */ |
| 43 |
/* { dg-final { scan-tree-dump-times "common.code" 1 "dom2" } } */ |