gcc/testsuite/gcc.c-torture/execute/pr58365.c
raw| 1 | /* PR rtl-optimization/58365 */ |
| 2 | |
| 3 | extern void abort (void); |
| 4 | |
| 5 | struct S |
| 6 | { |
| 7 | volatile int a; |
| 8 | int b, c, d, e; |
| 9 | } f; |
| 10 | static struct S g, h; |
| 11 | int i = 1; |
| 12 | |
| 13 | char |
| 14 | foo (void) |
| 15 | { |
| 16 | return i; |
| 17 | } |
| 18 | |
| 19 | static struct S |
| 20 | bar (void) |
| 21 | { |
| 22 | if (foo ()) |
| 23 | return f; |
| 24 | return g; |
| 25 | } |
| 26 | |
| 27 | int |
| 28 | main () |
| 29 | { |
| 30 | h = bar (); |
| 31 | f.b = 1; |
| 32 | if (h.b != 0) |
| 33 | abort (); |
| 34 | return 0; |
| 35 | } |