[cxx-mem-model] Generic atomic functions

Andrew MacLeod amacleod@redhat.com
Tue Oct 25 21:10:00 GMT 2011

On 10/25/2011 02:18 PM, Richard Henderson wrote:
> On 10/25/2011 10:20 AM, Andrew MacLeod wrote:
>> +   /* Otherwise there is a lockfree match, transform the call from:
>> +        void fn(T* mem, T* desired, T* return, model)
>> +      into
>> +        *((In *)return = fn (T* mem, *((In *)desired, model)  */
> This is, in general, an aliasing violation nearly guaranteed to fail.
> Instead try
>    *return = VCE<In>(fn(mem, VCE<In>(*desired), model))
> where VCE<T>(E) is a VIEW_CONVERT_EXPR with TREE_TYPE = T and a
> first operand expression of E.
> But in particular, the actual stores and loads happen in the original type.
OK, how's this.  (just the c-common.c file)

It seems to work fine. Past all the basic tests, and bootstraps in an 
incremental bootstrap.  I'll kick off a full scratch bootstrap/test 
before feeling all warm and fuzzy tho :-)

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: K
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20111025/e7fc3af3/attachment.ksh>

More information about the Gcc-patches mailing list