gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-20.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -fdump-tree-lim2-details" } */ |
| 3 | |
| 4 | /* Test that `count' is not hoisted out of loop when bb is cold. */ |
| 5 | |
| 6 | int count; |
| 7 | volatile int x; |
| 8 | |
| 9 | struct obj { |
| 10 | int data; |
| 11 | struct obj *next; |
| 12 | |
| 13 | } *q; |
| 14 | |
| 15 | void |
| 16 | func (int m) |
| 17 | { |
| 18 | struct obj *p; |
| 19 | for (int i = 0; i < m; i++) |
| 20 | if (__builtin_expect (x, 0)) |
| 21 | count++; |
| 22 | |
| 23 | } |
| 24 | |
| 25 | /* { dg-final { scan-tree-dump-not "Executing store motion of" "lim2" } } */ |