gcc/testsuite/gcc.dg/tree-ssa/slsr-10.c
raw| 1 | /* Verify straight-line strength reduction for simple integer addition |
| 2 | with stride reversed on 1st and 3rd instances. */ |
| 3 | |
| 4 | /* { dg-do compile } */ |
| 5 | /* { dg-options "-O3 -fdump-tree-optimized" } */ |
| 6 | |
| 7 | int |
| 8 | f (int s, int c) |
| 9 | { |
| 10 | int a1, a2, a3, x1, x2, x3, x; |
| 11 | |
| 12 | a1 = 2 * s; |
| 13 | x1 = a1 + c; |
| 14 | a2 = 4 * s; |
| 15 | x2 = c + a2; |
| 16 | a3 = 6 * s; |
| 17 | x3 = a3 + c; |
| 18 | x = x1 + x2 + x3; |
| 19 | return x; |
| 20 | } |
| 21 | |
| 22 | /* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */ |