summaryrefslogtreecommitdiff
path: root/gcc/config/m68k/sync.md
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/m68k/sync.md')
-rw-r--r--gcc/config/m68k/sync.md7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/config/m68k/sync.md b/gcc/config/m68k/sync.md
index 5d5002a9c81..6c840f51b60 100644
--- a/gcc/config/m68k/sync.md
+++ b/gcc/config/m68k/sync.md
@@ -62,8 +62,11 @@
(match_operand:SI 2 "const_int_operand" "")] ;; model
""
{
- emit_insn (gen_atomic_test_and_set_1 (operands[0], operands[1]));
- emit_insn (gen_negqi2 (operands[0], operands[0]));
+ rtx t = gen_reg_rtx (QImode);
+ emit_insn (gen_atomic_test_and_set_1 (t, operands[1]));
+ t = expand_simple_unop (QImode, NEG, t, operands[0], 0);
+ if (t != operands[0])
+ emit_move_insn (operands[0], t);
DONE;
})