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