Commit 80928237 by Richard Henderson Committed by Richard Henderson

re PR middle-end/55492 (__atomic_load doesn't match ACQUIRE memory model)

PR middle-end/55492

        * optabs.c (expand_atomic_load): Emit acquire barrier after the load.

From-SVN: r194490
parent 01f4c821
2012-12-13 Richard Henderson <rth@redhat.com>
PR middle-end/55492
* optabs.c (expand_atomic_load): Emit acquire barrier after the load.
2012-12-13 Richard Henderson <rth@redhat.com>
* config/alpha/alpha.c (alpha_pad_function_end): Consider barriers
when looking for NOTE_INSN_CALL_ARG_LOCATION.
......@@ -7468,14 +7468,14 @@ expand_atomic_load (rtx target, rtx mem, enum memmodel model)
if (!target || target == const0_rtx)
target = gen_reg_rtx (mode);
/* Emit the appropriate barrier before the load. */
expand_mem_thread_fence (model);
/* For SEQ_CST, emit a barrier before the load. */
if (model == MEMMODEL_SEQ_CST)
expand_mem_thread_fence (model);
emit_move_insn (target, mem);
/* For SEQ_CST, also emit a barrier after the load. */
if (model == MEMMODEL_SEQ_CST)
expand_mem_thread_fence (model);
/* Emit the appropriate barrier after the load. */
expand_mem_thread_fence (model);
return target;
}
......@@ -7536,13 +7536,13 @@ expand_atomic_store (rtx mem, rtx val, enum memmodel model, bool use_release)
return NULL_RTX;
}
/* If there is no mem_store, default to a move with barriers */
/* Otherwise assume stores are atomic, and emit the proper barriers. */
if (model == MEMMODEL_SEQ_CST || model == MEMMODEL_RELEASE)
expand_mem_thread_fence (model);
emit_move_insn (mem, val);
/* For SEQ_CST, also emit a barrier after the load. */
/* For SEQ_CST, also emit a barrier after the store. */
if (model == MEMMODEL_SEQ_CST)
expand_mem_thread_fence (model);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment