1/* { dg-do compile } */ 2/* { dg-options "-O2 -fdump-tree-cddce2" } */ 3 4struct rtx_def; 5typedef struct rtx_def *rtx; 6union tree_node; 7typedef union tree_node *tree; 8typedef struct mem_attrs 9{ 10 int foo; 11 12} mem_attrs; 13union rtunion_def 14{ 15 mem_attrs *rtmem; 16}; 17typedef union rtunion_def rtunion; 18struct rtx_def 19{ 20 rtunion fld[1]; 21}; 22struct tree_decl 23{ 24 rtx rtl; 25}; 26union tree_node 27{ 28 struct tree_decl decl; 29}; 30void * 31get_alias_set (t) 32 tree t; 33{ 34 long set; 35 if (t->decl.rtl) 36 return (t->decl.rtl->fld[1].rtmem 37 ? 0 38 : (((t->decl.rtl ? t->decl.rtl: (make_decl_rtl (t, 0), t->decl.rtl)))->fld[1]).rtmem); 39 return (void*)-1; 40} 41 42/* There should be precisely one load of ->decl.rtl. If there is 43 more than, then the dominator optimizations failed. */ 44/* { dg-final { scan-tree-dump-times "->decl\\.rtl" 1 "cddce2"} } */ 45 46/* There should be no loads of .rtmem since the complex return statement 47 is just "return 0". */ 48/* { dg-final { scan-tree-dump-times ".rtmem" 0 "cddce2"} } */ 49 50/* There should be one IF statement (the complex return statement should 51 collapse down to a simple return 0 without any conditionals). */ 52/* { dg-final { scan-tree-dump-times "if " 1 "cddce2"} } */ 53 54/* { dg-final { cleanup-tree-dump "cddce2" } } */ 55