[PR51752] publication safety violations in loop invariant motion pass

Michael Matz matz@suse.de
Mon Feb 27 17:26:00 GMT 2012


Hi,

On Mon, 27 Feb 2012, Aldy Hernandez wrote:

> 
> > > For that matter, didn't rth add a memory barrier at the beginning of
> > > transactions last week?  That would mean that we can't hoist anything
> > > outside of a transaction anyhow.  Or was it not a full memory barrier?
> >
> > It's now a full memory barrier for all global memory and for local statics
> > if their address is taken (and for automatic vars with their address taken).
> > Do we need to be concerned about non-address-taken local statics?
> 
> It is my understanding that non-address-taken local statics are not 
> visible to other threads,

void f () { static int i; i++; }

Running 'f' in different threads will expose the storage to 'i' to each of 
them without taking its address :-/


Ciao,
Michael.



More information about the Gcc-patches mailing list