libstdc++: Fix test_and_acquire for EABI
authorJonathan Wakely <jwakely@redhat.com>
Thu, 1 Oct 2020 11:54:37 +0000 (12:54 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 1 Oct 2020 11:54:37 +0000 (12:54 +0100)
libstdc++-v3/ChangeLog:

* config/cpu/arm/cxxabi_tweaks.h (_GLIBCXX_GUARD_TEST_AND_ACQUIRE):
Do not try to dereference return value of __atomic_load_n.

libstdc++-v3/config/cpu/arm/cxxabi_tweaks.h

index 4fb34869f8ac0359eb4460547c79783dd9e240f0..a08afed7d21de321f5223eaa5c9a60c92cd76737 100644 (file)
@@ -48,7 +48,7 @@ namespace __cxxabiv1
   typedef int __guard;
 
 #define _GLIBCXX_GUARD_TEST_AND_ACQUIRE(x) \
-  _GLIBCXX_GUARD_TEST(__atomic_load_n(x, __ATOMIC_ACQUIRE))
+  ((__atomic_load_n(x, __ATOMIC_ACQUIRE) & 1) != 0)
 #define _GLIBCXX_GUARD_SET_AND_RELEASE(x) \
   __atomic_store_n(x, 1, __ATOMIC_RELEASE)