gcc/testsuite/gcc.dg/loop-unswitch-2.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -funswitch-loops -fdump-tree-unswitch-all -fno-thread-jumps" } */ |
| 3 | |
| 4 | void foo (float **a, float **b, float *c, int n, int m, int l) |
| 5 | { |
| 6 | int i,j,k; |
| 7 | float s; |
| 8 | for (i=0; i<l; i++) |
| 9 | for (j=0; j<n; j++) |
| 10 | for (k=0; k<m; k++) |
| 11 | c[i] += a[i][k] * b[k][j]; |
| 12 | } |
| 13 | |
| 14 | /* { dg-final { scan-tree-dump-times "Guard hoisted" 3 "unswitch" } } */ |
| 15 | /* { dg-final { scan-tree-dump-not "Invalid sum" "unswitch" } } */ |