Merged revisions 196716,196830,198094,198116,198502,198877,199007,199262,199319,19946...
[official-gcc.git] / main / gcc / testsuite / gcc.dg / tree-ssa / slsr-37.c
blobfb13b20e142584cb1f880f390256f858bcf5c6c6
1 /* Verify straight-line strength reduction for a candidate with a basis
2 hidden by a phi dependence and having an unknown stride. Variation
3 using negative increments. */
5 /* { dg-do compile } */
6 /* { dg-options "-O3 -fdump-tree-optimized" } */
8 int
9 f (int s, int c, int i)
11 int a1, a2, a3, x1, x2, x3, x;
13 a1 = i * s;
14 x1 = c + a1;
16 i = i - 2;
17 a2 = i * s;
18 x2 = c + a2;
20 if (x2 > 6)
21 i = i - 2;
23 i = i - 2;
24 a3 = i * s;
25 x3 = c + a3;
27 x = x1 + x2 + x3;
28 return x;
31 /* { dg-final { scan-tree-dump-times " \\* s" 1 "optimized" } } */
32 /* { dg-final { scan-tree-dump-times " \\* 2" 1 "optimized" } } */
33 /* { dg-final { cleanup-tree-dump "optimized" } } */