2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / opt / pr81715.C
blobc38b22b7daa791456f368c0ab4c5411326dda452
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" }
6 struct S { int a, b, c, d, e; char f[1024]; };
7 void baz (int *, int *, int *, struct S *, int *, int *);
9 static inline struct S
10 foo (int a, int b, int c, struct S d, int e, int f)
12   struct S s;
13   baz (&a, &b, &c, &d, &e, &f);
14   s = d;
15   return s;
18 struct S g[64];
20 void
21 bar (int a, int b, int c, struct S d, int e, int f)
23 #define A(N) \
24   g[N+0] = foo (a, b, c, d, e, f);      \
25   g[N+1] = foo (a, b, c, d, e, f);      \
26   g[N+2] = foo (a, b, c, d, e, f);      \
27   g[N+3] = foo (a, b, c, d, e, f);      \
28   g[N+4] = foo (a, b, c, d, e, f);      \
29   g[N+5] = foo (a, b, c, d, e, f);      \
30   g[N+6] = foo (a, b, c, d, e, f);      \
31   g[N+7] = foo (a, b, c, d, e, f);      \
32   foo (a, b, c, d, e, f);               \
33   foo (a, b, c, d, e, f)
34   A(0); A(8); A(16); A(24);
35   A(32); A(40); A(48); A(56);