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
This commit is contained in:
Eric Botcazou 2013-08-02 21:41:58 +00:00 committed by Eric Botcazou
parent a572c45497
commit 13ec0527ea
2 changed files with 10 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2013-08-02 Eric Botcazou <ebotcazou@adacore.com>
* config/sparc/sparc.c (sparc_emit_membar_for_model) <SMM_TSO>: Add
the implied StoreLoad barrier for atomic operations if before.
2013-08-02 Jan Hubicka <jh@suse.cz>
Martin Liska <marxin.liska@gmail.com>

View file

@ -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: