| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-effective-target store_merge } */ |
| 3 |
/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging" } */ |
| 4 |
|
| 5 |
struct baz { |
| 6 |
struct bar { |
| 7 |
int a; |
| 8 |
char b; |
| 9 |
char c; |
| 10 |
char d; |
| 11 |
char e; |
| 12 |
char f; |
| 13 |
char g; |
| 14 |
} a[4]; |
| 15 |
} x; |
| 16 |
struct baz *xx = &x; |
| 17 |
|
| 18 |
void |
| 19 |
foo1 (int i) |
| 20 |
{ |
| 21 |
x.a[i].b = 0; |
| 22 |
x.a[i].a = 0; |
| 23 |
x.a[i].c = 0; |
| 24 |
x.a[i].d = 0; |
| 25 |
x.a[i].e = 0; |
| 26 |
} |
| 27 |
|
| 28 |
void |
| 29 |
foo2 (int i) |
| 30 |
{ |
| 31 |
x.a[i].b = 0; |
| 32 |
x.a[i].a = 0; |
| 33 |
x.a[i].c = 1; |
| 34 |
x.a[i].d = 0; |
| 35 |
x.a[i].e = 0; |
| 36 |
} |
| 37 |
|
| 38 |
/* { dg-final { scan-tree-dump-times "Merging successful" 2 "store-merging" } } */ |