public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Thomas Schwinge <thomas@codesourcery.com>
Cc: Martin Sebor <msebor@gmail.com>,
	libstdc++@gcc.gnu.org,        gcc-patches@gcc.gnu.org,
	Marek Polacek <polacek@redhat.com>,
	       "Joseph S. Myers" <joseph@codesourcery.com>,
	Jeff Law <law@redhat.com>
Subject: Re: [PR c/68966] Restore atomic builtins usage in libstdc++-v3
Date: Tue, 05 Apr 2016 19:04:00 -0000	[thread overview]
Message-ID: <20160405190419.GK5814@redhat.com> (raw)
In-Reply-To: <20160405180835.GJ5814@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 625 bytes --]

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.



[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 1263 bytes --]

commit 7591475c21a34bbcce6d225ea7640d35022fb8ff
Author: Jonathan Wakely <jwakely@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);

      reply	other threads:[~2016-04-05 19:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-23  4:46 [PATCH] c/68966 - atomic_fetch_* on atomic_bool not diagnosed Martin Sebor
2016-01-02  7:43 ` Jeff Law
2016-01-04  3:03   ` Martin Sebor
2016-01-04 15:22     ` Marek Polacek
2016-01-05  1:18       ` Martin Sebor
2016-01-05 10:51         ` Marek Polacek
2016-01-05 18:47           ` Martin Sebor
2016-01-06 11:50             ` Marek Polacek
2016-01-06 23:38               ` Martin Sebor
2016-01-07  0:08                 ` Mike Stump
2016-01-07 12:07                 ` Marek Polacek
2016-01-08  1:00                   ` Martin Sebor
2016-03-21 12:35 ` [PR c/68966] Restore atomic builtins usage in libstdc++-v3 (was: [PATCH] c/68966 - atomic_fetch_* on atomic_bool not diagnosed) Thomas Schwinge
2016-03-21 15:12   ` Jonathan Wakely
2016-03-21 16:04     ` [PR c/68966] Restore atomic builtins usage in libstdc++-v3 Thomas Schwinge
2016-04-05 11:01       ` Jonathan Wakely
2016-04-05 18:08         ` Jonathan Wakely
2016-04-05 19:04           ` Jonathan Wakely [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160405190419.GK5814@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=law@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    --cc=msebor@gmail.com \
    --cc=polacek@redhat.com \
    --cc=thomas@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).