annotate gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
kono
parents:
diff changeset
2 /* { dg-options "-O -fdump-tree-dce3" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 struct rtx_def;
kono
parents:
diff changeset
5 typedef struct rtx_def *rtx;
kono
parents:
diff changeset
6 union tree_node;
kono
parents:
diff changeset
7 typedef union tree_node *tree;
kono
parents:
diff changeset
8 typedef struct mem_attrs
kono
parents:
diff changeset
9 {
kono
parents:
diff changeset
10 int foo;
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 } mem_attrs;
kono
parents:
diff changeset
13 union rtunion_def
kono
parents:
diff changeset
14 {
kono
parents:
diff changeset
15 mem_attrs *rtmem;
kono
parents:
diff changeset
16 };
kono
parents:
diff changeset
17 typedef union rtunion_def rtunion;
kono
parents:
diff changeset
18 struct rtx_def
kono
parents:
diff changeset
19 {
kono
parents:
diff changeset
20 rtunion fld[1];
kono
parents:
diff changeset
21 };
kono
parents:
diff changeset
22 struct tree_decl
kono
parents:
diff changeset
23 {
kono
parents:
diff changeset
24 rtx rtl;
kono
parents:
diff changeset
25 };
kono
parents:
diff changeset
26 union tree_node
kono
parents:
diff changeset
27 {
kono
parents:
diff changeset
28 struct tree_decl decl;
kono
parents:
diff changeset
29 };
kono
parents:
diff changeset
30 int make_decl_rtl (tree, int);
kono
parents:
diff changeset
31 void *
kono
parents:
diff changeset
32 get_alias_set (t)
kono
parents:
diff changeset
33 tree t;
kono
parents:
diff changeset
34 {
kono
parents:
diff changeset
35 long set;
kono
parents:
diff changeset
36 if (t->decl.rtl)
kono
parents:
diff changeset
37 return (t->decl.rtl->fld[1].rtmem
kono
parents:
diff changeset
38 ? 0
kono
parents:
diff changeset
39 : (((t->decl.rtl ? t->decl.rtl: (make_decl_rtl (t, 0), t->decl.rtl)))->fld[1]).rtmem);
kono
parents:
diff changeset
40 return (void*)-1;
kono
parents:
diff changeset
41 }
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 /* There should be precisely one load of ->decl.rtl. If there is
kono
parents:
diff changeset
44 more than, then the dominator optimizations failed. */
kono
parents:
diff changeset
45 /* { dg-final { scan-tree-dump-times "->decl\\.rtl" 1 "dce3"} } */
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 /* There should be no loads of .rtmem since the complex return statement
kono
parents:
diff changeset
48 is just "return 0". */
kono
parents:
diff changeset
49 /* { dg-final { scan-tree-dump-times ".rtmem" 0 "dce3"} } */
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 /* There should be one IF statement (the complex return statement should
kono
parents:
diff changeset
52 collapse down to a simple return 0 without any conditionals). */
kono
parents:
diff changeset
53 /* { dg-final { scan-tree-dump-times "if " 1 "dce3"} } */
kono
parents:
diff changeset
54