This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR51752] publication safety violations in loop invariant motion pass
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.