| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O3 -fno-ipa-sra -fdump-ipa-cp-details -fdump-tree-optimized-slim" } */ |
| 3 |
/* { dg-add-options bind_pic_locally } */ |
| 4 |
|
| 5 |
struct S |
| 6 |
{ |
| 7 |
int a, b, c; |
| 8 |
}; |
| 9 |
|
| 10 |
void *blah(int, void *); |
| 11 |
|
| 12 |
static void __attribute__ ((noinline)) |
| 13 |
foo (struct S *p) |
| 14 |
{ |
| 15 |
int i, c = p->c; |
| 16 |
int b = p->b; |
| 17 |
void *v = (void *) p; |
| 18 |
|
| 19 |
for (i= 0; i< c; i++) |
| 20 |
v = blah(b + i, v); |
| 21 |
} |
| 22 |
|
| 23 |
void |
| 24 |
entry (void) |
| 25 |
{ |
| 26 |
struct S s; |
| 27 |
s.a = 1; |
| 28 |
s.b = 64; |
| 29 |
s.c = 32; |
| 30 |
foo (&s); |
| 31 |
} |
| 32 |
|
| 33 |
/* { dg-final { scan-ipa-dump "ref offset\[^\n\r\]*: 64\[^\n\r\]*scc:" "cp" } } */ |
| 34 |
/* { dg-final { scan-ipa-dump "Creating a specialized node of foo.*for all known contexts" "cp" } } */ |
| 35 |
/* { dg-final { scan-ipa-dump-times "Aggregate replacements:" 2 "cp" } } */ |
| 36 |
/* { dg-final { scan-tree-dump-not "->c;" "optimized" } } */ |