* alias.c (read_dependence): Return true for ALIAS_SET_MEMORY_BARRIER.
authorRichard Henderson <rth@redhat.com>
Tue, 4 Sep 2012 18:16:24 +0000 (11:16 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 4 Sep 2012 18:16:24 +0000 (11:16 -0700)
From-SVN: r190941

gcc/ChangeLog
gcc/alias.c

index cc3a2ed16d55c103d3d2a52eda2bd5bc57c46a4a..11bbf7eb8716c541d9f365bccaf84909ac9ab6e5 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  Richard Guenther  <rguenther@suse.de>
 
        * tree-ssa-pre.c (value_expressions): Make it a vector of
index c1d5c8a8f364a9a962feba91a2cbf3d1201c26f7..b7182074c5d9ca3ef85a6b7eac480ccd1bfd6e06 100644 (file)
@@ -2177,12 +2177,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;
 }
 
 /* Return true if we can determine that the fields referenced cannot