gcc/testsuite/gcc.dg/tree-ssa/slsr-20.c
raw| 1 | /* Verify straight-line strength reduction for multiply candidates |
| 2 | with stride in inconsistent positions. */ |
| 3 | |
| 4 | /* { dg-do compile } */ |
| 5 | /* { dg-options "-O3 -fdump-tree-optimized" } */ |
| 6 | |
| 7 | int |
| 8 | f (int c, int s) |
| 9 | { |
| 10 | int x1, x2, y1, y2; |
| 11 | |
| 12 | y1 = c + 2; |
| 13 | x1 = y1 * s; |
| 14 | y2 = y1 + 2; |
| 15 | x2 = s * y2; |
| 16 | return x1 + x2; |
| 17 | } |
| 18 | |
| 19 | /* { dg-final { scan-tree-dump-times " \\* s" 1 "optimized" } } */ |
| 20 | /* { dg-final { scan-tree-dump-times " \\* 2" 1 "optimized" } } */ |