| 1 |
// PR sanitizer/81715 |
| 2 |
// { dg-do compile } |
| 3 |
// Verify the variables for inlined foo parameters are reused |
| 4 |
// { dg-options "-O2 -Wframe-larger-than=16384" } |
| 5 |
// { dg-require-effective-target size20plus } |
| 6 |
|
| 7 |
struct S { int a, b, c, d, e; char f[1024]; }; |
| 8 |
void baz (int *, int *, int *, struct S *, int *, int *); |
| 9 |
|
| 10 |
static inline struct S |
| 11 |
foo (int a, int b, int c, struct S d, int e, int f) |
| 12 |
{ |
| 13 |
struct S s; |
| 14 |
baz (&a, &b, &c, &d, &e, &f); |
| 15 |
s = d; |
| 16 |
return s; |
| 17 |
} |
| 18 |
|
| 19 |
struct S g[64]; |
| 20 |
|
| 21 |
void |
| 22 |
bar (int a, int b, int c, struct S d, int e, int f) |
| 23 |
{ |
| 24 |
#define A(N) \ |
| 25 |
g[N+0] = foo (a, b, c, d, e, f); \ |
| 26 |
g[N+1] = foo (a, b, c, d, e, f); \ |
| 27 |
g[N+2] = foo (a, b, c, d, e, f); \ |
| 28 |
g[N+3] = foo (a, b, c, d, e, f); \ |
| 29 |
g[N+4] = foo (a, b, c, d, e, f); \ |
| 30 |
g[N+5] = foo (a, b, c, d, e, f); \ |
| 31 |
g[N+6] = foo (a, b, c, d, e, f); \ |
| 32 |
g[N+7] = foo (a, b, c, d, e, f); \ |
| 33 |
foo (a, b, c, d, e, f); \ |
| 34 |
foo (a, b, c, d, e, f) |
| 35 |
A(0); A(8); A(16); A(24); |
| 36 |
A(32); A(40); A(48); A(56); |
| 37 |
} |