1 /* { dg-do compile } */ 2 /* { dg-options "-O1 -fdump-tree-dom2" } */ 3 4 extern void abort (void); 5 extern void blah (void); 6 7 union tree_node; 8 typedef union tree_node *tree; 9 struct tree_vec 10 { 11 int length; 12 tree a[1]; 13 }; 14 struct tree_type 15 { 16 tree binfo; 17 }; 18 union tree_node 19 { 20 struct tree_type type; 21 struct tree_vec vec; 22 }; 23 24 void record_component_aliases(type)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