annotate gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-19.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 "-O2 -fdump-tree-pre-stats" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 struct Loc {
kono
parents:
diff changeset
5 int x[3];
kono
parents:
diff changeset
6 };
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 void bar (struct Loc *);
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 int foo (int i, int j, int k, int b)
kono
parents:
diff changeset
11 {
kono
parents:
diff changeset
12 struct Loc IND;
kono
parents:
diff changeset
13 int res;
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 if (b)
kono
parents:
diff changeset
16 {
kono
parents:
diff changeset
17 IND.x[0] = i;
kono
parents:
diff changeset
18 IND.x[1] = j;
kono
parents:
diff changeset
19 IND.x[2] = k-1;
kono
parents:
diff changeset
20 }
kono
parents:
diff changeset
21 else
kono
parents:
diff changeset
22 {
kono
parents:
diff changeset
23 IND.x[0] = i;
kono
parents:
diff changeset
24 IND.x[1] = j;
kono
parents:
diff changeset
25 IND.x[2] = k;
kono
parents:
diff changeset
26 }
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 /* This should be optimized to i + j + {k, k + 1}. */
kono
parents:
diff changeset
29 res = IND.x[0] + IND.x[1] + IND.x[2];
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 /* This is just to prevent SRA. */
kono
parents:
diff changeset
32 bar (&IND);
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 return res;
kono
parents:
diff changeset
35 }
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 /* All three loads should be eliminated. */
kono
parents:
diff changeset
38 /* { dg-final { scan-tree-dump "Eliminated: 3" "pre" } } */