111
|
1 /* { dg-do compile } */
|
131
|
2 /* { dg-options "-O1 -fdump-tree-phicprop1" } */
|
111
|
3
|
|
4 extern void abort (void);
|
|
5 extern void blah (void);
|
|
6 union tree_node;
|
|
7 typedef union tree_node *tree;
|
|
8 struct tree_vec
|
|
9 {
|
|
10 int length;
|
|
11 tree a[1];
|
|
12 };
|
|
13 struct tree_type
|
|
14 {
|
|
15 tree binfo;
|
|
16 };
|
|
17 union tree_node
|
|
18 {
|
|
19 struct tree_type type;
|
|
20 struct tree_vec vec;
|
|
21 };
|
|
22 void
|
|
23 record_component_aliases (type)
|
|
24 tree type;
|
|
25 {
|
|
26 if (type->type.binfo->vec.length)
|
|
27 abort ();
|
|
28 for (; ((
|
|
29 {
|
|
30 const tree __z = type->type.binfo;
|
|
31 if (type->type.binfo->vec.length)
|
|
32 abort ();
|
|
33 type->type.binfo->vec.a[4];}
|
|
34 )->vec.length);)
|
|
35 {
|
|
36 if (4 >= type->type.binfo->vec.length)
|
|
37 abort ();
|
|
38 blah ();
|
|
39 }
|
|
40 }
|
|
41
|
|
42 /* The call to blah should have been eliminated. If the call is not
|
|
43 eliminated, then dominator optimizations failed and it'll be
|
|
44 impossible to delete other unnecessary code. */
|
131
|
45 /* { dg-final { scan-tree-dump-not "blah \\(\\)" "phicprop1" } } */
|
111
|
46
|
|
47 /* There should be two IF conditionals. */
|
131
|
48 /* { dg-final { scan-tree-dump-times "if " 2 "phicprop1"} } */
|
111
|
49
|
|
50 /* There should be a single load of type.binfo. */
|
131
|
51 /* { dg-final { scan-tree-dump-times "type\\.binfo" 1 "phicprop1"} } */
|
111
|
52
|
|
53 /* There should be two loads of vec.length. */
|
131
|
54 /* { dg-final { scan-tree-dump-times "vec.length" 2 "phicprop1"} } */
|
111
|
55
|