https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65979
--- Comment #18 from Oleg Endo <olegendo at gcc dot gnu.org> --- (In reply to Kazumoto Kojima from comment #16) > > Also arguments of emit_move_insn must have the same integer modes. > > if (reg_overlap_mentioned_p (operands[1], operands[2])) > std::swap (operands[0], operands[2]); > > sh_check_add_incdec_notes (emit_move_insn (operands[2], operands[3])); > > might ICE if operands[0] and operands[2] have different modes and > swap happens, though I'm not sure whether such insns are real or not. Yes, that is true. However, because op0, op1, op2 are all "arith_reg_dest" the peephole will only match if those are GP regs. Each captured insn will only reference a single GP reg, because DImode moves should have been smashed into SImode moves before the peephole2 pass. Thus, I think it should be safe to just force the mode of op0 to SImode. I'll try it out.