| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-effective-target store_merge } */ |
| 3 |
/* { dg-options "-O2 -fdump-tree-store-merging" } */ |
| 4 |
|
| 5 |
/* Check that we can merge interleaving stores that are guaranteed |
| 6 |
to be non-aliasing. */ |
| 7 |
|
| 8 |
struct bar |
| 9 |
{ |
| 10 |
int a; |
| 11 |
char b; |
| 12 |
char c; |
| 13 |
short d; |
| 14 |
char e; |
| 15 |
char f; |
| 16 |
char g; |
| 17 |
}; |
| 18 |
|
| 19 |
void |
| 20 |
foozero (struct bar *restrict p, struct bar *restrict p2) |
| 21 |
{ |
| 22 |
p->b = 0xff; |
| 23 |
p2->b = 0xa; |
| 24 |
p->a = 0xfffff; |
| 25 |
p2->a = 0xab; |
| 26 |
p2->c = 0xc; |
| 27 |
p->c = 0xff; |
| 28 |
p2->d = 0xbf; |
| 29 |
p->d = 0xfff; |
| 30 |
} |
| 31 |
|
| 32 |
/* { dg-final { scan-tree-dump-times "Merging successful" 2 "store-merging" } } */ |