aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c
blob: 8b6d5c31dcc9613d682be4333e2186fc793b3a67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-cddce2" } */
  
struct rtx_def;
typedef struct rtx_def *rtx;
union tree_node;
typedef union tree_node *tree;
typedef struct mem_attrs
{
  int  foo;

} mem_attrs;
union rtunion_def
{
  mem_attrs *rtmem;
};
typedef union rtunion_def rtunion;
struct rtx_def
{
  rtunion fld[1];
};
struct tree_decl
{
  rtx rtl;
};
union tree_node
{
  struct tree_decl decl;
};
void *
get_alias_set (t)
     tree t;
{
  long set;
  if (t->decl.rtl)
    return (t->decl.rtl->fld[1].rtmem 
	    ? 0
	    : (((t->decl.rtl ? t->decl.rtl: (make_decl_rtl (t, 0), t->decl.rtl)))->fld[1]).rtmem);
  return (void*)-1;
}

/* There should be precisely one load of ->decl.rtl.  If there is
   more than, then the dominator optimizations failed.  */
/* { dg-final { scan-tree-dump-times "->decl\\.rtl" 1 "cddce2"} } */
  
/* There should be no loads of .rtmem since the complex return statement
   is just "return 0".  */
/* { dg-final { scan-tree-dump-times ".rtmem" 0 "cddce2"} } */
  
/* There should be one IF statement (the complex return statement should
   collapse down to a simple return 0 without any conditionals).  */
/* { dg-final { scan-tree-dump-times "if " 0 "cddce2"} } */
/* { dg-final { scan-tree-dump-times "0B ? " 1 "cddce2"} } */

/* { dg-final { cleanup-tree-dump "cddce2" } } */