| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-sink1-details -fdump-tree-cddce2-details" } */ |
| 3 |
|
| 4 |
static int b=4; |
| 5 |
int c; |
| 6 |
|
| 7 |
int |
| 8 |
main() |
| 9 |
{ |
| 10 |
int e[5] = {1,1,1,1,1}; |
| 11 |
for (; b >= 0; b--) { |
| 12 |
c = e[b]; |
| 13 |
} |
| 14 |
return 0; |
| 15 |
} |
| 16 |
|
| 17 |
/* We should sink e[b] out of the loop which is possible after |
| 18 |
applying store motion to c and b. */ |
| 19 |
/* { dg-final { scan-tree-dump "Sinking # VUSE" "sink1" } } */ |
| 20 |
/* And remove the loop after final value replacement. */ |
| 21 |
/* { dg-final { scan-tree-dump "fix_loop_structure: removing loop" "cddce2" } } */ |