gcc/testsuite/gcc.dg/pr33434-3.c
raw| 1 | /* PR tree-optimization/33434 */ |
| 2 | /* { dg-do run } */ |
| 3 | /* { dg-options "-O3" } */ |
| 4 | |
| 5 | int k; |
| 6 | |
| 7 | void __attribute__((noinline)) f2 (int b) |
| 8 | { |
| 9 | k = b - 1; |
| 10 | } |
| 11 | |
| 12 | void f1 (int a, int b) |
| 13 | { |
| 14 | f2 (b); |
| 15 | a = 1; |
| 16 | b = 1; |
| 17 | if (a) |
| 18 | while (b --) |
| 19 | k = 1; |
| 20 | else |
| 21 | if (b != 1) |
| 22 | __builtin_abort (); |
| 23 | } |
| 24 | |
| 25 | int main (void) |
| 26 | { |
| 27 | f1 (1, 1); |
| 28 | if (k != 1) |
| 29 | __builtin_abort (); |
| 30 | return 0; |
| 31 | } |