On 05/04/16 19:08 +0100, Jonathan Wakely wrote:
On 05/04/16 12:01 +0100, Jonathan Wakely wrote:
Well I guess it's mine, and this is a fairly serious regression (is it
tracked in Bugzilla anywhere?) so the patch is OK for trunk.
This is now https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70554
I've committed this smaller change, which still tests atomics for
bool, but simply removes the uses of __atomic_fetch_add for bool.
During stage 1 we can revisit whether we want to do something more
invasive and stop testing for atomics that we don't actually need.
Tested ppc64le-linux, x86_64-linux, comitted to trunk.
commit 7591475c21a34bbcce6d225ea7640d35022fb8ff
Author: Jonathan Wakely <jwak...@redhat.com>
Date: Tue Apr 5 19:16:05 2016 +0100
Restore atomic builtins usage in libstdc++-v3
PR libstdc++/70554
* acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Don't test
__atomic_fetch_add for bool.
* configure: Regenerate.
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 95df24a..b0f88cb 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -3290,7 +3290,7 @@ AC_DEFUN([GLIBCXX_ENABLE_ATOMIC_BUILTINS], [
atomic_type c1;
atomic_type c2;
atomic_type c3(0);
- __atomic_fetch_add(&c1, c2, __ATOMIC_RELAXED);
+ // N.B. __atomic_fetch_add is not supported for bool.
__atomic_compare_exchange_n(&c1, &c2, c3, true, __ATOMIC_ACQ_REL,
__ATOMIC_RELAXED);
__atomic_test_and_set(&c1, __ATOMIC_RELAXED);
@@ -3375,7 +3375,7 @@ int main()
atomic_type c1;
atomic_type c2;
atomic_type c3(0);
- __atomic_fetch_add(&c1, c2, __ATOMIC_RELAXED);
+ // N.B. __atomic_fetch_add is not supported for bool.
__atomic_compare_exchange_n(&c1, &c2, c3, true, __ATOMIC_ACQ_REL,
__ATOMIC_RELAXED);
__atomic_test_and_set(&c1, __ATOMIC_RELAXED);