summaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-04 18:16:24 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-04 18:16:24 +0000
commiteae726e9e188dae97f8baaed76a408e8f1567e85 (patch)
treec26952d4fe2c91ddbb7b057e700a75ec0c0fc84b /gcc/alias.c
parentbc343e4a4ce388d186730164ec9c259d5a41867b (diff)
downloadgcc-eae726e9e188dae97f8baaed76a408e8f1567e85.tar.gz
* alias.c (read_dependence): Return true for ALIAS_SET_MEMORY_BARRIER.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190941 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index c1d5c8a8f36..b7182074c5d 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -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