1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-tree-dom2 -fdump-tree-optimized" } */
3 
4 extern void abort (void);
5 union tree_node;
6 typedef union tree_node *tree;
7 extern const char tree_code_type[];
8 struct tree_common
9 {
10   int code;
11 };
12 struct tree_decl
13 {
14   long pointer_alias_set;
15 };
16 union tree_node
17 {
18   struct tree_common common;
19   struct tree_decl decl;
20 };
21 long oof (void);
22 void record_alias_subset (long);
23 long
blah(decl,set)24 blah (decl, set)
25      tree decl;
26      long set;
27 {
28   decl->decl.pointer_alias_set = oof();
29   if (tree_code_type[decl->common.code] != 'd')
30     abort ();
31   record_alias_subset (decl->decl.pointer_alias_set);
32   if (set != -1)
33     set = 0;
34   return set;
35 }
36 
37 /* There should be precisely one reference to pointer_alias_set.  If there is
38    more than one, then the dominator optimizations failed.  */
39 /* { dg-final { scan-tree-dump-times "pointer_alias_set" 1 "dom2"} } */
40 
41 /* The assignment set = -1 in the ELSE clause of the last IF
42    statement should be removed by the final cleanup phase.  */
43 /* { dg-final { scan-tree-dump-times "set = -1" 0 "optimized"} } */
44