From: Jonathan Wakely Date: Thu, 1 Oct 2020 11:54:37 +0000 (+0100) Subject: libstdc++: Fix test_and_acquire for EABI X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=026ca1121c2f4514494c10860ef3c49f18eccf9d;p=gcc.git libstdc++: Fix test_and_acquire for EABI 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. --- diff --git a/libstdc++-v3/config/cpu/arm/cxxabi_tweaks.h b/libstdc++-v3/config/cpu/arm/cxxabi_tweaks.h index 4fb34869f8a..a08afed7d21 100644 --- a/libstdc++-v3/config/cpu/arm/cxxabi_tweaks.h +++ b/libstdc++-v3/config/cpu/arm/cxxabi_tweaks.h @@ -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)