| 1 |
/* Bug 117164: ICE with -std=gnu23 inlining function containing call |
| 2 |
to non-inlined nested function returning variable-size struct. */ |
| 3 |
/* { dg-do run } */ |
| 4 |
/* { dg-options "-O3 --param ipa-cp-eval-threshold=0 -fno-guess-branch-probability -fno-inline-small-functions -std=gnu23" } */ |
| 5 |
|
| 6 |
void |
| 7 |
foo (int n) |
| 8 |
{ |
| 9 |
struct S { int a[n]; }; |
| 10 |
|
| 11 |
struct S |
| 12 |
fn (void) |
| 13 |
{ |
| 14 |
struct S s; |
| 15 |
s.a[0] = 42; |
| 16 |
return s; |
| 17 |
} |
| 18 |
|
| 19 |
fn (); |
| 20 |
fn (); |
| 21 |
fn (); |
| 22 |
} |
| 23 |
|
| 24 |
int |
| 25 |
main (void) |
| 26 |
{ |
| 27 |
foo (1); |
| 28 |
} |