| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O1 -fdump-tree-esra-details" } */ |
| 3 |
|
| 4 |
struct S |
| 5 |
{ |
| 6 |
int i; |
| 7 |
int j; |
| 8 |
char c[32]; /* this disables total scalarization */ |
| 9 |
}; |
| 10 |
|
| 11 |
extern struct S bar(void); |
| 12 |
|
| 13 |
int foo1 (int b) |
| 14 |
{ |
| 15 |
struct S s1; |
| 16 |
|
| 17 |
s1 = bar (); |
| 18 |
return s1.i; |
| 19 |
} |
| 20 |
|
| 21 |
extern struct S *g; |
| 22 |
|
| 23 |
int foo2 (void) |
| 24 |
{ |
| 25 |
struct S s2; |
| 26 |
|
| 27 |
s2 = *g; |
| 28 |
return s2.i; |
| 29 |
} |
| 30 |
|
| 31 |
/* { dg-final { scan-tree-dump-times "Created a replacement for s1" 0 "esra"} } */ |
| 32 |
/* { dg-final { scan-tree-dump-times "Created a replacement for s2" 1 "esra"} } */ |