blob: 99e455cce52105f9595f6eb8ca87e34ec2a5c6ab (
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
37
38
39
40
41
42
43
44
45
|
/* PR tree-optimization/93945 */
union U { char a[8]; struct S { unsigned int b : 8, c : 13, d : 11; } e; } u;
__attribute__((noipa)) int
foo (void)
{
__builtin_memset (&u.a, 0xf4, sizeof (u.a));
return u.e.c;
}
__attribute__((noipa)) int
bar (void)
{
asm volatile ("" : : "g" (&u) : "memory");
return u.e.c;
}
__attribute__((noipa)) int
baz (void)
{
__builtin_memset (&u.a, 0xf4, sizeof (u.a));
return u.e.d;
}
__attribute__((noipa)) int
qux (void)
{
asm volatile ("" : : "g" (&u) : "memory");
return u.e.d;
}
int
main ()
{
int a = foo ();
int b = bar ();
if (a != b)
__builtin_abort ();
a = baz ();
b = qux ();
if (a != b)
__builtin_abort ();
return 0;
}
|