On 11/26/2015 10:46 AM, Richard Biener wrote:

Ok with the change suggested by Micha for the asm()s.  Note that I
originally used gimple_vuse () instead of gimple_vdef () as even
reading random memory is a barrier for the compiler to move stores
across it (not reads, of course).  Which is why I also considered
pure (global memory reading) calls to be a barrier (for the stores).

Yes, but IIUC the stores aren't being moved, they may just be turned into unconditional ones. Being nontrapping is one necessary condition for that (which we already compute), but we also want to make sure that we don't introduce surprises for threaded programs.

Of course as we don't consider regular assign statement reads (or stores)
to be a "barrier" in the sense that matters here (we're not looking for
memory optimization barriers!) this might be moot and then the
middle-end will effectively require all synchronization barriers (which we
are looking for(?)) to appear as clobbering memory.

If I read this correctly you have reached the same conclusions. Test results came back ok (with vdef tested for asms), and I've committed the change.


Bernd

Reply via email to