annotate gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2 /* { dg-options "-O1 -fdump-tree-phicprop1" } */
111
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 extern void abort (void);
kono
parents:
diff changeset
5 extern void blah (void);
kono
parents:
diff changeset
6 union tree_node;
kono
parents:
diff changeset
7 typedef union tree_node *tree;
kono
parents:
diff changeset
8 struct tree_vec
kono
parents:
diff changeset
9 {
kono
parents:
diff changeset
10 int length;
kono
parents:
diff changeset
11 tree a[1];
kono
parents:
diff changeset
12 };
kono
parents:
diff changeset
13 struct tree_type
kono
parents:
diff changeset
14 {
kono
parents:
diff changeset
15 tree binfo;
kono
parents:
diff changeset
16 };
kono
parents:
diff changeset
17 union tree_node
kono
parents:
diff changeset
18 {
kono
parents:
diff changeset
19 struct tree_type type;
kono
parents:
diff changeset
20 struct tree_vec vec;
kono
parents:
diff changeset
21 };
kono
parents:
diff changeset
22 void
kono
parents:
diff changeset
23 record_component_aliases (type)
kono
parents:
diff changeset
24 tree type;
kono
parents:
diff changeset
25 {
kono
parents:
diff changeset
26 if (type->type.binfo->vec.length)
kono
parents:
diff changeset
27 abort ();
kono
parents:
diff changeset
28 for (; ((
kono
parents:
diff changeset
29 {
kono
parents:
diff changeset
30 const tree __z = type->type.binfo;
kono
parents:
diff changeset
31 if (type->type.binfo->vec.length)
kono
parents:
diff changeset
32 abort ();
kono
parents:
diff changeset
33 type->type.binfo->vec.a[4];}
kono
parents:
diff changeset
34 )->vec.length);)
kono
parents:
diff changeset
35 {
kono
parents:
diff changeset
36 if (4 >= type->type.binfo->vec.length)
kono
parents:
diff changeset
37 abort ();
kono
parents:
diff changeset
38 blah ();
kono
parents:
diff changeset
39 }
kono
parents:
diff changeset
40 }
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 /* The call to blah should have been eliminated. If the call is not
kono
parents:
diff changeset
43 eliminated, then dominator optimizations failed and it'll be
kono
parents:
diff changeset
44 impossible to delete other unnecessary code. */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
45 /* { dg-final { scan-tree-dump-not "blah \\(\\)" "phicprop1" } } */
111
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 /* There should be two IF conditionals. */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
48 /* { dg-final { scan-tree-dump-times "if " 2 "phicprop1"} } */
111
kono
parents:
diff changeset
49
kono
parents:
diff changeset
50 /* There should be a single load of type.binfo. */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
51 /* { dg-final { scan-tree-dump-times "type\\.binfo" 1 "phicprop1"} } */
111
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 /* There should be two loads of vec.length. */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
54 /* { dg-final { scan-tree-dump-times "vec.length" 2 "phicprop1"} } */
111
kono
parents:
diff changeset
55