| 1 |
/* PR middle-end/113596 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -fdump-tree-einline" } */ |
| 4 |
/* { dg-final { scan-tree-dump-times "__builtin_stack_save \\\(" 3 "einline" } } */ |
| 5 |
/* { dg-final { scan-tree-dump-times "__builtin_stack_restore \\\(" 3 "einline" } } */ |
| 6 |
|
| 7 |
void baz (char *p, int n); |
| 8 |
volatile int v; |
| 9 |
|
| 10 |
static inline __attribute__((always_inline)) void |
| 11 |
foo (int n) |
| 12 |
{ |
| 13 |
++v; |
| 14 |
{ |
| 15 |
char *p = __builtin_alloca (n); |
| 16 |
baz (p, n); |
| 17 |
} |
| 18 |
++v; |
| 19 |
} |
| 20 |
|
| 21 |
static inline __attribute__((always_inline)) void |
| 22 |
bar (int n) |
| 23 |
{ |
| 24 |
++v; |
| 25 |
{ |
| 26 |
char p[n]; |
| 27 |
baz (p, n); |
| 28 |
} |
| 29 |
++v; |
| 30 |
} |
| 31 |
|
| 32 |
void |
| 33 |
qux (int n) |
| 34 |
{ |
| 35 |
foo (n); |
| 36 |
bar (n); |
| 37 |
} |