PR testsuite/52641
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / slsr-33.c
blob5cd4276577b89be5b001c64972f65192e4dba2fa
1 /* Verify straight-line strength reduction for a candidate with a basis
2 hidden by a phi dependence and having a known stride. */
4 /* { dg-do compile } */
5 /* { dg-options "-O3 -fdump-tree-optimized" } */
7 int
8 f (int c, int i)
10 int a1, a2, a3, x1, x2, x3, x;
12 a1 = i * 16;
13 x1 = c + a1;
15 i = i + 2;
16 a2 = i * 16;
17 x2 = c + a2;
19 if (x2 > 6)
20 i = i + 2;
22 i = i + 2;
23 a3 = i * 16;
24 x3 = c + a3;
26 x = x1 + x2 + x3;
27 return x;
30 /* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
31 /* { dg-final { cleanup-tree-dump "optimized" } } */