Re: [PATCH] Clarify __atomic_compare_exchange_n docs

2016-01-13 Thread Jonathan Wakely
On 13/01/16 10:16 -0700, Sandra Loosemore wrote: On 01/13/2016 07:27 AM, Jonathan Wakely wrote: On 03/10/15 14:00 +0100, Jonathan Wakely wrote: Here's the latest version of the patch, including the typo fix. Is this patch OK for trunk? The original thread faded out, it's split across two mon

Re: [PATCH] Clarify __atomic_compare_exchange_n docs

2016-01-13 Thread Sandra Loosemore
On 01/13/2016 07:27 AM, Jonathan Wakely wrote: On 03/10/15 14:00 +0100, Jonathan Wakely wrote: Here's the latest version of the patch, including the typo fix. Is this patch OK for trunk? The original thread faded out, it's split across two months in the archives: https://gcc.gnu.org/ml/gcc-p

Re: [PATCH] Clarify __atomic_compare_exchange_n docs

2016-01-13 Thread Jonathan Wakely
On 03/10/15 14:00 +0100, Jonathan Wakely wrote: Here's the latest version of the patch, including the typo fix. Is this patch OK for trunk? The original thread faded out, it's split across two months in the archives: https://gcc.gnu.org/ml/gcc-patches/2015-09/msg02190.html https://gcc.gnu.org

Re: [PATCH] Clarify __atomic_compare_exchange_n docs

2015-10-03 Thread Jonathan Wakely
Here's the latest version of the patch, including the typo fix. 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

Re: [PATCH] Clarify __atomic_compare_exchange_n docs

2015-10-01 Thread Jonathan Wakely
There's a typo in an example too. diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index ce1b4ae..599ad87 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -9471,7 +9471,7 @@ alignment. A value of 0 indicates typical alignment should be used. The compiler may also ignore this

Re: [PATCH] Clarify __atomic_compare_exchange_n docs

2015-10-01 Thread Jonathan Wakely
On 01/10/15 11:57 -0600, Sandra Loosemore wrote: H, yes. Looking at the section as a whole, is it a bug in the implementation that the built-ins only "approximately match" the C++11 requirements? AFAIK they exactly match, so I don't know why the docs say that. If there were an exact corr

Re: [PATCH] Clarify __atomic_compare_exchange_n docs

2015-10-01 Thread Sandra Loosemore
On 10/01/2015 05:28 AM, Andrew Haley wrote: On 09/29/2015 04:21 PM, Sandra Loosemore wrote: What is "weak compare_exchange", and what is "the strong variation", and how do they differ in terms of behavior? It's in C++11 29.6.5: Remark: The weak compare-and-exchange operations may fail spuriou

Re: [PATCH] Clarify __atomic_compare_exchange_n docs

2015-10-01 Thread Jonathan Wakely
On 01/10/15 18:34 +0100, Andrew Haley wrote: On 10/01/2015 06:32 PM, Jonathan Wakely wrote: I would suggest we don't try to reproduce the standard definition, but just say the weak version can fail spuriously and the strong can't. IMHO this isn't the place to educate people in the fine points of

Re: [PATCH] Clarify __atomic_compare_exchange_n docs

2015-10-01 Thread Andrew Haley
On 10/01/2015 06:32 PM, Jonathan Wakely wrote: > I would suggest we don't try to reproduce the standard definition, but > just say the weak version can fail spuriously and the strong can't. > IMHO this isn't the place to educate people in the fine points of > low-level atomics. As it says, "when in

Re: [PATCH] Clarify __atomic_compare_exchange_n docs

2015-10-01 Thread Jonathan Wakely
On 01/10/15 12:28 +0100, Andrew Haley wrote: On 09/29/2015 04:21 PM, Sandra Loosemore wrote: What is "weak compare_exchange", and what is "the strong variation", and how do they differ in terms of behavior? It's in C++11 29.6.5: Remark: The weak compare-and-exchange operations may fail spurio

Re: [PATCH] Clarify __atomic_compare_exchange_n docs

2015-10-01 Thread Andrew Haley
On 09/29/2015 04:21 PM, Sandra Loosemore wrote: > What is "weak compare_exchange", and what is "the strong variation", and > how do they differ in terms of behavior? It's in C++11 29.6.5: Remark: The weak compare-and-exchange operations may fail spuriously, that is, return false while leaving th

Re: [PATCH] Clarify __atomic_compare_exchange_n docs

2015-09-29 Thread Sandra Loosemore
On 09/29/2015 06:00 AM, Jonathan Wakely wrote: Someone on IRC incorrectly parsed the docs at https://gcc.gnu.org/onlinedocs/gcc-5.2.0/gcc/_005f_005fatomic-Builtins.html#index-g_t_005f_005fatomic_005fcompare_005fexchange_005fn-3536 as: IF ( desired is written into *ptr AND the execu

[PATCH] Clarify __atomic_compare_exchange_n docs

2015-09-29 Thread Jonathan Wakely
Someone on IRC incorrectly parsed the docs at https://gcc.gnu.org/onlinedocs/gcc-5.2.0/gcc/_005f_005fatomic-Builtins.html#index-g_t_005f_005fatomic_005fcompare_005fexchange_005fn-3536 as: IF ( desired is written into *ptr AND the execution is considered to conform to the memory model sp