gcc/testsuite/gcc.dg/tree-ssa/slsr-15.c
raw| 1 | /* Straight-line strength reduction control flow variation. */ |
| 2 | |
| 3 | /* { dg-do compile } */ |
| 4 | /* { dg-options "-O3 -fdump-tree-optimized" } */ |
| 5 | |
| 6 | int |
| 7 | f (int n, int c, int s) |
| 8 | { |
| 9 | int a, x1, x2, x3; |
| 10 | |
| 11 | x1 = x2 = x3 = c; |
| 12 | |
| 13 | if (n > 64) |
| 14 | { |
| 15 | a = 2 * s; |
| 16 | x1 = c + a; |
| 17 | a = 4 * s; |
| 18 | x2 = c + a; |
| 19 | a = 6 * s; |
| 20 | x3 = c + a; |
| 21 | } |
| 22 | |
| 23 | return x1 + x2 + x3; |
| 24 | } |
| 25 | |
| 26 | /* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */ |