* tree-loop-distribution.c (INCLUDE_ALGORITHM): New header file.
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / slsr-31.c
blob149db618ca5e64991ddeeab95c8ca51f5af2e5bc
1 /* Verify straight-line strength reduction for add candidates in
2 which the stride is unknown and increments appear that differ
3 only in sign. Verify the increments are shared. */
5 /* { dg-do compile } */
6 /* { dg-options "-O3 -fdump-tree-optimized" } */
8 int
9 f (int s, int c)
11 int a1, a2, a3, a4, x1, x2, x3, x4, x;
13 a1 = 2 * s;
14 x1 = c + a1;
15 a2 = 4 * s; /* incr = +2 */
16 x2 = c + a2;
17 a3 = 7 * s;
18 x3 = c + a3;
19 a4 = 5 * s; /* incr = -2 */
20 x4 = c + a4;
21 x = x1 + x2 + x3 + x4;
22 return x;
25 /* { dg-final { scan-tree-dump-times " \\* 2" 1 "optimized" } } */
26 /* { dg-final { scan-tree-dump-times " \\* -2" 0 "optimized" } } */