https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87720
--- Comment #2 from Paul Hua <paul.hua.gm at gmail dot com> --- untested patch: Index: gcc/combine.c =================================================================== --- gcc/combine.c (revision 265456) +++ gcc/combine.c (working copy) @@ -14965,7 +14965,11 @@ if (TEST_HARD_REG_BIT (fixed_reg_set, REGNO (src))) continue; - rtx new_reg = gen_reg_rtx (GET_MODE (dest)); + rtx new_reg; + if (GET_CODE(dest) == PC) + new_reg = gen_reg_rtx (GET_MODE (src)); + else + new_reg = gen_reg_rtx (GET_MODE (dest)); rtx_insn *insn1 = gen_move_insn (new_reg, src); rtx_insn *insn2 = gen_move_insn (dest, new_reg); emit_insn_after (insn1, insn); Index: gcc/expr.c =================================================================== --- gcc/expr.c (revision 265456) +++ gcc/expr.c (working copy) @@ -3684,7 +3684,12 @@ rtx_insn * emit_move_insn_1 (rtx x, rtx y) { - machine_mode mode = GET_MODE (x); + machine_mode mode; + if (GET_CODE (x) == PC) + mode = GET_MODE (y); + else /* Include (GET_CODE (y) = PC) */ + mode = GET_MODE (x); + enum insn_code code; gcc_assert ((unsigned int) mode < (unsigned int) MAX_MACHINE_MODE);