| 1 |
/* PR tree-optimization/82434 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-require-effective-target store_merge } */ |
| 4 |
/* { dg-options "-O2 -fdump-tree-store-merging" } */ |
| 5 |
|
| 6 |
enum E { E0, E1, E2 = __INT_MAX__, E3 = -__INT_MAX__ - 1 }; |
| 7 |
|
| 8 |
struct bar { |
| 9 |
enum E a; |
| 10 |
char b; |
| 11 |
_Bool c; |
| 12 |
short d; |
| 13 |
}; |
| 14 |
|
| 15 |
void |
| 16 |
foo1 (struct bar *p) |
| 17 |
{ |
| 18 |
p->b = 0; |
| 19 |
p->a = E0; |
| 20 |
p->c = (_Bool) 0; |
| 21 |
p->d = 0; |
| 22 |
} |
| 23 |
|
| 24 |
void |
| 25 |
foo2 (struct bar *p) |
| 26 |
{ |
| 27 |
p->b = 0; |
| 28 |
p->a = E0; |
| 29 |
p->c = (_Bool) 1; |
| 30 |
p->d = 0; |
| 31 |
} |
| 32 |
|
| 33 |
/* { dg-final { scan-tree-dump-times "Merging successful" 2 "store-merging" } } */ |