diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2013-01-18 12:34:11 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2013-01-18 12:34:11 -0800 |
commit | 43269d882367dc4f0e4c2651d6625e1b7de78764 (patch) | |
tree | 6aaf525a6fb8a4fb63a71c9ca56be58bc1d6655b /gcc/optabs.c | |
parent | ce97ec0e268b7b50b9f801dd12ffc67042c47193 (diff) | |
parent | 48dc1117de124a2265129a36bfbbc211522c2c02 (diff) | |
download | gcc-hjl/tsx/gcc-4_7-branch.tar.gz |
Merge remote-tracking branch 'origin/gcc-4_7-branch' into hjl/tsx/gcc-4_7-branchhjl/tsx/gcc-4_7-branch
Conflicts:
gcc/config/i386/driver-i386.c
gcc/config/i386/i386.c
gcc/config/i386/sync.md
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r-- | gcc/optabs.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c index fd353d7e627..91b4661090d 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -7700,14 +7700,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; } @@ -7768,13 +7768,12 @@ 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 */ - if (model == MEMMODEL_SEQ_CST || model == MEMMODEL_RELEASE) - expand_mem_thread_fence (model); + /* Otherwise assume stores are atomic, and emit the proper barriers. */ + 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); |