blob: 4ac9addbc04e8d6a2b432a0564eeaea65c03da6e (
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
|
/* PR target/81979 */
/* { dg-do link } */
/* { dg-options "-O2 -w" } */
/* { dg-additional-options "-fPIC" { target fpic } } */
/* { dg-additional-options "-freorder-blocks-and-partition" { target freorder } } */
int d;
__attribute__((noinline, noclone)) void
foo (int x)
{
int c;
while (c < 1)
{
int o;
for (o = 0; o < 4; ++o)
c /= (x != 0) ? 2 : x;
}
d = 1;
for (;;)
;
}
int
main ()
{
asm volatile ("" : : "r" (&d) : "memory");
foo (d);
asm volatile ("" : : "r" (&d) : "memory");
return 0;
}
|