aboutsummaryrefslogtreecommitdiff
path: root/nptl/sysdeps/ia64/bits/atomic.h
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps/ia64/bits/atomic.h')
-rw-r--r--nptl/sysdeps/ia64/bits/atomic.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/nptl/sysdeps/ia64/bits/atomic.h b/nptl/sysdeps/ia64/bits/atomic.h
index cfccc6ad71..fab23076cd 100644
--- a/nptl/sysdeps/ia64/bits/atomic.h
+++ b/nptl/sysdeps/ia64/bits/atomic.h
@@ -76,20 +76,22 @@ typedef uintmax_t uatomic_max_t;
__val = *__memp; \
if (sizeof (*mem) == 4) \
do \
- __oldval = __val; \
- while ((__val \
- = __arch_compare_and_exchange_32_val_acq (__memp, \
- __oldval + __value, \
- __oldval)) \
- != __oldval); \
+ { \
+ __oldval = __val; \
+ __val = __arch_compare_and_exchange_32_val_acq (__memp, \
+ __oldval + __value, \
+ __oldval); \
+ } \
+ while (__builtin_expect (__val != __oldval, 0)); \
else if (sizeof (*mem) == 8) \
do \
- __oldval = __val; \
- while ((__val \
- = __arch_compare_and_exchange_64_val_acq (__memp, \
- __oldval + __value, \
- __oldval)) \
- != __oldval); \
+ { \
+ __oldval = __val; \
+ __val = __arch_compare_and_exchange_64_val_acq (__memp, \
+ __oldval + __value, \
+ __oldval); \
+ } \
+ while (__builtin_expect (__val != __oldval, 0)); \
else \
abort (); \
__oldval + __value; })