From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36268 invoked by alias); 3 Oct 2015 13:00:31 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 36243 invoked by uid 89); 3 Oct 2015 13:00:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sat, 03 Oct 2015 13:00:29 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 6CC25C0A148E; Sat, 3 Oct 2015 13:00:28 +0000 (UTC) Received: from localhost (ovpn-116-138.ams2.redhat.com [10.36.116.138]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t93D0RtA024673; Sat, 3 Oct 2015 09:00:27 -0400 Date: Sat, 03 Oct 2015 13:00:00 -0000 From: Jonathan Wakely To: Sandra Loosemore Cc: Andrew Haley , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Clarify __atomic_compare_exchange_n docs Message-ID: <20151003130026.GG12094@redhat.com> References: <20150929120038.GW12094@redhat.com> <560AAC7B.4030904@codesourcery.com> <560D18EB.5090900@redhat.com> <560D73F5.9090908@codesourcery.com> <20151001183518.GL12094@redhat.com> <20151001184007.GN12094@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="WxezjuMNsgvRf6mf" Content-Disposition: inline In-Reply-To: <20151001184007.GN12094@redhat.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-10/txt/msg00307.txt.bz2 --WxezjuMNsgvRf6mf Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-length: 65 Here's the latest version of the patch, including the typo fix. --WxezjuMNsgvRf6mf Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" Content-length: 2188 commit 96468d6b7e782501459bad306b31d45bc0ba5155 Author: Jonathan Wakely Date: Sat Oct 3 13:59:47 2015 +0100 Clarify __atomic_compare_exchange effects * doc/extend.texi (__atomic Builtins): Clarify compare_exchange effects. diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 8406945..599ad87 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -9353,17 +9353,18 @@ This compares the contents of @code{*@var{ptr}} with the contents of @code{*@var{expected}}. If equal, the operation is a @emph{read-modify-write} operation that writes @var{desired} into @code{*@var{ptr}}. If they are not equal, the operation is a @emph{read} and the current contents of -@code{*@var{ptr}} is written into @code{*@var{expected}}. @var{weak} is true -for weak compare_exchange, and false for the strong variation. Many targets +@code{*@var{ptr}} are written into @code{*@var{expected}}. @var{weak} is true +for weak compare_exchange, which may fail spuriously, and false for +the strong variation, which never fails spuriously. Many targets only offer the strong variation and ignore the parameter. When in doubt, use the strong variation. -True is returned if @var{desired} is written into -@code{*@var{ptr}} and the operation is considered to conform to the +If @var{desired} is written into @code{*@var{ptr}} then true is returned +and memory is affected according to the memory order specified by @var{success_memorder}. There are no restrictions on what memory order can be used here. -False is returned otherwise, and the operation is considered to conform +Otherwise, false is returned and memory is affected according to @var{failure_memorder}. This memory order cannot be @code{__ATOMIC_RELEASE} nor @code{__ATOMIC_ACQ_REL}. It also cannot be a stronger order than that specified by @var{success_memorder}. @@ -9470,7 +9471,7 @@ alignment. A value of 0 indicates typical alignment should be used. The compiler may also ignore this parameter. @smallexample -if (_atomic_always_lock_free (sizeof (long long), 0)) +if (__atomic_always_lock_free (sizeof (long long), 0)) @end smallexample @end deftypefn --WxezjuMNsgvRf6mf--