annotate gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.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-cddce1" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 int main(void)
kono
parents:
diff changeset
5 {
kono
parents:
diff changeset
6 unsigned i, j;
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 for (i = 1, j = 0; i != 0; i+=2)
kono
parents:
diff changeset
9 {
kono
parents:
diff changeset
10 j += 500;
kono
parents:
diff changeset
11 if (j % 7)
kono
parents:
diff changeset
12 {
kono
parents:
diff changeset
13 j++;
kono
parents:
diff changeset
14 }
kono
parents:
diff changeset
15 else
kono
parents:
diff changeset
16 {
kono
parents:
diff changeset
17 j--;
kono
parents:
diff changeset
18 }
kono
parents:
diff changeset
19 }
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 return 0;
kono
parents:
diff changeset
22 }
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 /* We now can prove the infiniteness of the loop during CCP and fail
kono
parents:
diff changeset
25 to eliminate the code inside the infinite loop because we start
kono
parents:
diff changeset
26 by marking the j % 7 condition as useful. See PR45178. */
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 /* We should eliminate the inner condition, but the loop must be preserved
kono
parents:
diff changeset
29 as it is infinite. Therefore there should be just one goto and no PHI. */
kono
parents:
diff changeset
30 /* { dg-final { scan-tree-dump-times "PHI " 0 "cddce1" } } */
kono
parents:
diff changeset
31 /* { dg-final { scan-tree-dump-times "goto" 1 "cddce1" } } */