1 /* PR target/81979 */
2 /* { dg-do link } */
3 /* { dg-options "-O2 -w" } */
4 /* { dg-additional-options "-fPIC" { target fpic } } */
5 /* { dg-additional-options "-freorder-blocks-and-partition" { target freorder } } */
6
7 int d;
8
9 __attribute__((noinline, noclone)) void
10 foo (int x)
11 {
12 int c;
13 while (c < 1)
14 {
15 int o;
16 for (o = 0; o < 4; ++o)
17 c /= (x != 0) ? 2 : x;
18 }
19
20 d = 1;
21 for (;;)
22 ;
23 }
24
25 int
26 main ()
27 {
28 asm volatile ("" : : "r" (&d) : "memory");
29 foo (d);
30 asm volatile ("" : : "r" (&d) : "memory");
31 return 0;
32 }