PR testsuite/52641
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-dce-3.c
blob72020aac7f3e91fe4f82da1a5f2e95695a42815c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-cddce1" } */
4 int main(void)
6 unsigned i, j;
8 for (i = 1, j = 0; i != 0; i+=2)
10 j += 500;
11 if (j % 7)
13 j++;
15 else
17 j--;
21 return 0;
24 /* We now can prove the infiniteness of the loop during CCP and fail
25 to eliminate the code inside the infinite loop because we start
26 by marking the j % 7 condition as useful. See PR45178. */
28 /* We should eliminate the inner condition, but the loop must be preserved
29 as it is infinite. Therefore there should be just one phi node (for i): */
30 /* { dg-final { scan-tree-dump-times "PHI " 1 "cddce1" { xfail *-*-* } } } */
32 /* And one if (for the exit condition of the loop): */
33 /* { dg-final { scan-tree-dump-times "if " 1 "cddce1" } } */
35 /* { dg-final { cleanup-tree-dump "cddce1" } } */