| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-ipa-sra-details" } */ |
| 3 |
|
| 4 |
struct S |
| 5 |
{ |
| 6 |
short a, b, c; |
| 7 |
}; |
| 8 |
|
| 9 |
volatile int gc; |
| 10 |
volatile int *arr; |
| 11 |
|
| 12 |
static void __attribute__((noinline)) |
| 13 |
foo (struct S *p) |
| 14 |
{ |
| 15 |
for (int i = 0; i < gc; i++) |
| 16 |
arr += p->b; |
| 17 |
} |
| 18 |
|
| 19 |
void |
| 20 |
bar (short a, short b, short c) |
| 21 |
{ |
| 22 |
struct S s; |
| 23 |
s.a = a; |
| 24 |
s.b = b; |
| 25 |
s.c = c; |
| 26 |
foo (&s); |
| 27 |
return; |
| 28 |
} |
| 29 |
|
| 30 |
void |
| 31 |
baz (void) |
| 32 |
{ |
| 33 |
foo ((struct S *) 0); |
| 34 |
} |
| 35 |
|
| 36 |
void __attribute__((noipa)) |
| 37 |
confuse (void) |
| 38 |
{ |
| 39 |
gc = 0; |
| 40 |
baz (); |
| 41 |
} |
| 42 |
|
| 43 |
int |
| 44 |
main (int argc, char **argv) |
| 45 |
{ |
| 46 |
confuse (); |
| 47 |
return 0; |
| 48 |
} |
| 49 |
|
| 50 |
/* { dg-final { scan-ipa-dump-not "Will split parameter" "sra" } } */ |
| 51 |
|