| 1 |
/* PR tree-optimization/90271 */ |
| 2 |
/* { dg-do run { target int32 } } */ |
| 3 |
/* { dg-require-effective-target store_merge } */ |
| 4 |
/* { dg-options "-O2 -fdump-tree-store-merging-details" } */ |
| 5 |
/* { dg-final { scan-tree-dump "New sequence of 1 stores to replace old one of 2 stores" "store-merging" } } */ |
| 6 |
|
| 7 |
__attribute__((noipa)) void |
| 8 |
foo (int *x) |
| 9 |
{ |
| 10 |
asm volatile ("" : : "r" (x) : "memory"); |
| 11 |
} |
| 12 |
|
| 13 |
__attribute__((noipa)) int |
| 14 |
bar () |
| 15 |
{ |
| 16 |
int x; |
| 17 |
foo (&x); |
| 18 |
x = 3; |
| 19 |
((char *) &x)[1] = 1; |
| 20 |
foo (&x); |
| 21 |
return x; |
| 22 |
} |
| 23 |
|
| 24 |
int |
| 25 |
main () |
| 26 |
{ |
| 27 |
int x; |
| 28 |
foo (&x); |
| 29 |
x = 3; |
| 30 |
foo (&x); |
| 31 |
((char *) &x)[1] = 1; |
| 32 |
foo (&x); |
| 33 |
if (x != bar ()) |
| 34 |
__builtin_abort (); |
| 35 |
return 0; |
| 36 |
} |