1/* { dg-do compile } */
2/* { dg-options "-O1 -fdump-tree-dom2" } */
3
4extern void abort (void);
5extern void blah (void);
6
7union tree_node;
8typedef union tree_node *tree;
9struct tree_vec
10{
11          int length;
12            tree a[1];
13};
14struct tree_type
15{
16          tree binfo;
17};
18union tree_node
19{
20          struct tree_type type;
21            struct tree_vec vec;
22};
23
24void
25record_component_aliases (type)
26     tree type;
27{
28  int i;
29  if (4 >= type->type.binfo->vec.length)
30    abort ();
31  for (; i < ((
32                {
33                const tree __t = type->type.binfo;
34                if (4 >= __t->vec.length)
35                abort (); type->type.binfo->vec.a[4];}
36              )->vec.length);)
37    {
38      if (4 >= type->type.binfo->vec.length)
39        abort ();
40      blah ();
41    }
42}
43
44/* The call to blah can not be eliminated.  */
45/* { dg-final { scan-tree-dump-times "blah \\(\\)" 1 "dom2" } } */
46
47/* There should be four IF conditionals.  */
48/* { dg-final { scan-tree-dump-times "if " 4 "dom2"} } */
49
50/* There should be two loads of type.binfo.  */
51/* { dg-final { scan-tree-dump-times "type\\.binfo" 2 "dom2"} } */
52
53/* There should be four loads of vec.length.  */
54/* { dg-final { scan-tree-dump-times "vec.length" 4 "dom2"} } */
55
56/* { dg-final { cleanup-tree-dump "dom2" } } */
57