> --- Comment #1 from Mikael Pettersson <mikpe at it dot uu.se> 2012-03-04 > 21:01:28 UTC --- > Created attachment 26827 > --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26827 > reduced test case in C > > Depends on target CPU selection. -mcpu=680[012346]0 and -mcpu=cpu32 all work, > but -mcpu=5206 (or apparently any other coldfire) ICEs.
Indeed. Fixed by not trying to use negqi2 directly, but going through the normal expanders which will DTRT for coldfire. Tested via cross-compile, committed to mainline and 4.7. r~
PR target/52481 * config/m68k/sync.md (atomic_test_and_set): Use expand_simple_unop instead of calling negqi2 directly. diff --git a/gcc/config/m68k/sync.md b/gcc/config/m68k/sync.md index 5d5002a..6c840f5 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; })