OSDN Git Service

* alias.c (read_dependence): Return true for ALIAS_SET_MEMORY_BARRIER.
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Sep 2012 18:17:54 +0000 (18:17 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Sep 2012 18:17:54 +0000 (18:17 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@190942 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/alias.c

index 0b7ba90..e71ab91 100644 (file)
@@ -1,3 +1,7 @@
+2012-09-04  Richard Henderson  <rth@redhat.com>
+
+       * alias.c (read_dependence): Return true for ALIAS_SET_MEMORY_BARRIER.
+
 2012-09-04  Georg-Johann Lay  <avr@gjlay.de>
 
        Backport from 2012-09-04 mainline r190920
index e9d701f..f20716d 100644 (file)
@@ -2127,12 +2127,18 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c)
    storeqi_unaligned pattern.  */
 
 /* Read dependence: X is read after read in MEM takes place.  There can
-   only be a dependence here if both reads are volatile.  */
+   only be a dependence here if both reads are volatile, or if either is
+   an explicit barrier.  */
 
 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