gcc/testsuite/gcc.dg/torture/pr123416.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-additional-options "-fno-strict-aliasing" } */ |
| 3 | |
| 4 | struct a { |
| 5 | int b; |
| 6 | } c; |
| 7 | |
| 8 | int d; |
| 9 | |
| 10 | static struct a |
| 11 | g() |
| 12 | { |
| 13 | int a[2], b, f = 0; |
| 14 | for (; f < 2; f++) |
| 15 | a[f] = 1; |
| 16 | b = a[0]; |
| 17 | if (b) |
| 18 | return c; |
| 19 | } |
| 20 | int main() |
| 21 | { |
| 22 | c.b = 1; |
| 23 | struct a e = g(); |
| 24 | c = g(); |
| 25 | if (!c.b || !e.b) |
| 26 | __builtin_abort(); |
| 27 | return 0; |
| 28 | } |