gcc/testsuite/gcc.dg/tree-ssa/pr100794.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -ftree-loop-vectorize -fdump-tree-pcom-details -fdisable-tree-vect" } */ |
| 3 | |
| 4 | extern double arr[100]; |
| 5 | extern double foo (double, double); |
| 6 | extern double sum; |
| 7 | |
| 8 | void |
| 9 | test (int i_0, int i_n) |
| 10 | { |
| 11 | int i; |
| 12 | for (i = i_0; i < i_n - 1; i++) |
| 13 | { |
| 14 | double a = arr[i]; |
| 15 | double b = arr[i + 1]; |
| 16 | sum += a * b; |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | /* { dg-final { scan-tree-dump "Executing predictive commoning without unrolling" "pcom" } } */ |