| 1 |
/* PR middle-end/101170 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -g" } */ |
| 4 |
|
| 5 |
#include <stdarg.h> |
| 6 |
|
| 7 |
struct S { int a; int b[4]; } s; |
| 8 |
va_list ap; |
| 9 |
int i; |
| 10 |
long long l; |
| 11 |
|
| 12 |
struct S |
| 13 |
foo (int x) |
| 14 |
{ |
| 15 |
struct S a = {}; |
| 16 |
do |
| 17 |
if (x) |
| 18 |
return a; |
| 19 |
while (1); |
| 20 |
} |
| 21 |
|
| 22 |
__attribute__((noipa)) void |
| 23 |
bar (void) |
| 24 |
{ |
| 25 |
for (; i; i++) |
| 26 |
l |= va_arg (ap, long long) << s.b[i]; |
| 27 |
if (l) |
| 28 |
foo (l); |
| 29 |
} |
| 30 |
|
| 31 |
void |
| 32 |
baz (int v, ...) |
| 33 |
{ |
| 34 |
va_start (ap, v); |
| 35 |
bar (); |
| 36 |
va_end (ap); |
| 37 |
} |