gcc/testsuite/g++.dg/torture/pr60895.C
raw| 1 | // { dg-do compile } |
| 2 | |
| 3 | struct C |
| 4 | { |
| 5 | double elems[3]; |
| 6 | }; |
| 7 | |
| 8 | C |
| 9 | foo () |
| 10 | { |
| 11 | C a; |
| 12 | double *f = a.elems; |
| 13 | int b; |
| 14 | for (; b;) |
| 15 | { |
| 16 | *f = 0; |
| 17 | ++f; |
| 18 | } |
| 19 | return a; |
| 20 | } |
| 21 | |
| 22 | struct J |
| 23 | { |
| 24 | C c; |
| 25 | __attribute__((always_inline)) J () : c (foo ()) {} |
| 26 | }; |
| 27 | |
| 28 | void |
| 29 | bar () |
| 30 | { |
| 31 | J (); |
| 32 | } |