gcc/testsuite/gcc.dg/pr108657.c
raw| 1 | /* PR tree-optimization/108657 */ |
| 2 | /* { dg-do run } */ |
| 3 | /* { dg-options "-O3 -ftrivial-auto-var-init=zero" } */ |
| 4 | |
| 5 | int c, e, f; |
| 6 | static int *d = &c; |
| 7 | |
| 8 | __attribute__((noipa)) void |
| 9 | foo (void) |
| 10 | { |
| 11 | if (c != 1) |
| 12 | __builtin_abort (); |
| 13 | } |
| 14 | |
| 15 | int |
| 16 | main () |
| 17 | { |
| 18 | for (c = 1; c >= 0; c--) |
| 19 | { |
| 20 | e = 0; |
| 21 | for (int j = 0; j <= 2; j++) |
| 22 | { |
| 23 | short k[1]; |
| 24 | if (e) |
| 25 | break; |
| 26 | e ^= f; |
| 27 | } |
| 28 | } |
| 29 | *d = 1; |
| 30 | foo (); |
| 31 | } |