1 /* Verify straight-line strength reduction for a candidate with a basis
2 hidden by two phi dependences, and having a known stride. */
3
4 /* { dg-do compile } */
5 /* { dg-options "-O3 -fdump-tree-optimized" } */
6
7 extern void
8 g (void);
9
10 int
f(int c,int i)11 f (int c, int i)
12 {
13 int a1, a2, a3, x1, x2, x3, x;
14
15 a1 = i * 16;
16 x1 = c + a1;
17
18 i = i + 2;
19 a2 = i * 16;
20 x2 = c + a2;
21
22 if (x2 > 6)
23 {
24 if (c < 200)
25 i = i + 2;
26 else
27 i = i + 4;
28 g ();
29 }
30 else
31 i = i + 6;
32
33 i = i + 2;
34 a3 = i * 16;
35 x3 = c + a3;
36
37 x = x1 + x2 + x3;
38 return x;
39 }
40
41 /* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
42 /* { dg-final { scan-tree-dump-times "PHI" 2 "optimized" } } */
43