| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fno-ipa-cp -fipa-sra -fdump-ipa-sra" } */ |
| 3 |
|
| 4 |
struct bovid |
| 5 |
{ |
| 6 |
float red; |
| 7 |
int green; |
| 8 |
void *blue; |
| 9 |
}; |
| 10 |
|
| 11 |
extern void foo (float, void *, void *, long); |
| 12 |
|
| 13 |
static int |
| 14 |
__attribute__((noinline)) |
| 15 |
ox (struct bovid cow, int z, struct bovid calf, long l) |
| 16 |
{ |
| 17 |
foo (cow.red, cow.blue, cow.blue, l); |
| 18 |
return 0; |
| 19 |
} |
| 20 |
|
| 21 |
void caller (void) |
| 22 |
{ |
| 23 |
struct bovid cow, calf; |
| 24 |
|
| 25 |
cow.red = 7.4; |
| 26 |
cow.green = 6; |
| 27 |
cow.blue = &cow; |
| 28 |
|
| 29 |
calf.red = 8.4; |
| 30 |
calf.green = 5; |
| 31 |
calf.blue = &cow; |
| 32 |
|
| 33 |
ox (cow,4,calf,2); |
| 34 |
return; |
| 35 |
} |
| 36 |
|
| 37 |
/* { dg-final { scan-ipa-dump "Will split parameter 0" "sra" } } */ |
| 38 |
/* { dg-final { scan-ipa-dump "Will remove parameter 1" "sra" } } */ |
| 39 |
/* { dg-final { scan-ipa-dump "Will remove parameter 2" "sra" } } */ |