gcc/testsuite/gcc.dg/tree-ssa/pr61385.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2" } */ |
| 3 | |
| 4 | #define assert(x) if (!(x)) __builtin_abort () |
| 5 | |
| 6 | int a, b, c, d, e, f, g; |
| 7 | |
| 8 | int |
| 9 | fn1 () |
| 10 | { |
| 11 | int *h = &c; |
| 12 | for (; c < 1; c++) |
| 13 | { |
| 14 | int *i = &a, *k = &a; |
| 15 | f = 0; |
| 16 | if (b) |
| 17 | return 0; |
| 18 | if (*h) |
| 19 | { |
| 20 | int **j = &i; |
| 21 | *j = 0; |
| 22 | d = 0; |
| 23 | } |
| 24 | else |
| 25 | g = e = 0; |
| 26 | if (*h) |
| 27 | { |
| 28 | int **l = &k; |
| 29 | *l = &g; |
| 30 | } |
| 31 | d &= *h; |
| 32 | assert (k == &a || k); |
| 33 | assert (i); |
| 34 | } |
| 35 | return 0; |
| 36 | } |
| 37 | |
| 38 | int |
| 39 | main () |
| 40 | { |
| 41 | fn1 (); |
| 42 | return 0; |
| 43 | } |