| 1 |
/* PR tree-optimization/109362 */ |
| 2 |
/* { dg-do compile { target lp64 } } */ |
| 3 |
/* { dg-options "-O2 -masm=att" } */ |
| 4 |
/* Ensure we don't waste a register set to %rdi + 8. */ |
| 5 |
/* { dg-final { scan-assembler "\tmovq\t\\\(%rdi\\\), %r" } } */ |
| 6 |
/* { dg-final { scan-assembler "\tmovq\t8\\\(%rdi\\\), %r" } } */ |
| 7 |
|
| 8 |
struct S { long a, b; }; |
| 9 |
|
| 10 |
int |
| 11 |
foo (struct S *v) |
| 12 |
{ |
| 13 |
while (1) |
| 14 |
{ |
| 15 |
__atomic_load_n (&v->a, __ATOMIC_ACQUIRE); |
| 16 |
if (__atomic_load_n (&v->b, __ATOMIC_ACQUIRE)) |
| 17 |
return 1; |
| 18 |
} |
| 19 |
} |