Message ID | 5040EB8E.6090403@redhat.com |
---|---|
State | New |
Headers | show |
On Fri, Aug 31, 2012 at 6:51 PM, Richard Henderson <rth@redhat.com> wrote: > Fixed as follows. This seems to be the only entry point in alias.c that didn't take ALIAS_SET_MEMORY_BARRIER into account. Getting the above into a test case is tricky, and I havn't figured out how to match it. > > Full testing still underway, but I expect it to pass. Any reason to not add the (mem:BLK (scratch)) special case as well? Ciao! Steven
> Full testing still underway, but I expect it to pass.
Can you also update the comment before the function, please? It now reads:
/* Read dependence: X is read after read in MEM takes place. There can
only be a dependence here if both reads are volatile. */
But that's no longer true after your patch.
Ciao!
Steven
diff --git a/gcc/alias.c b/gcc/alias.c index e9d701f..5848e75 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -2132,7 +2132,12 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c) int read_dependence (const_rtx mem, const_rtx x) { - return MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem); + if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem)) + return true; + if (MEM_ALIAS_SET (x) == ALIAS_SET_MEMORY_BARRIER + || MEM_ALIAS_SET (mem) == ALIAS_SET_MEMORY_BARRIER) + return true; + return false; } /* Returns nonzero if something about the mode or address format MEM1