aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/sparc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2013-08-02 21:41:58 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2013-08-02 21:41:58 +0000
commit13ec0527eae61e42c9b0356a9752d6fa4702c2c3 (patch)
treebcb6148b7d9d28bb66be04f13d7efe19d28bfb32 /gcc/config/sparc
parenta572c4549742bb0876335f3be4c5a76fac555454 (diff)
downloadgcc-13ec0527eae61e42c9b0356a9752d6fa4702c2c3.zip
gcc-13ec0527eae61e42c9b0356a9752d6fa4702c2c3.tar.gz
gcc-13ec0527eae61e42c9b0356a9752d6fa4702c2c3.tar.bz2
sparc.c (sparc_emit_membar_for_model): Add the implied StoreLoad barrier for atomic operations if before.
* config/sparc/sparc.c (sparc_emit_membar_for_model) <SMM_TSO>: Add the implied StoreLoad barrier for atomic operations if before. From-SVN: r201450
Diffstat (limited to 'gcc/config/sparc')
-rw-r--r--gcc/config/sparc/sparc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 48c25dc..87cfaca 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -11318,6 +11318,11 @@ sparc_emit_membar_for_model (enum memmodel model,
/* Total Store Ordering: all memory transactions with store semantics
are followed by an implied StoreStore. */
implied |= StoreStore;
+
+ /* If we're not looking for a raw barrer (before+after), then atomic
+ operations get the benefit of being both load and store. */
+ if (load_store == 3 && before_after == 1)
+ implied |= StoreLoad;
/* FALLTHRU */
case SMM_PSO: