1 /* Verify straight-line strength reduction for a candidate with a basis
2 hidden by a phi dependence and having a known stride. Variation using
3 negative increments. */
4
5 /* { dg-do compile } */
6 /* { dg-options "-O3 -fdump-tree-optimized" } */
7
8 int
f(int c,int i)9 f (int c, int i)
10 {
11 int a1, a2, a3, x1, x2, x3, x;
12
13 a1 = i * 16;
14 x1 = c + a1;
15
16 i = i - 2;
17 a2 = i * 16;
18 x2 = c + a2;
19
20 if (x2 > 6)
21 i = i - 2;
22
23 i = i - 2;
24 a3 = i * 16;
25 x3 = c + a3;
26
27 x = x1 + x2 + x3;
28 return x;
29 }
30
31 /* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
32