Commit aef7647f by Segher Boessenkool Committed by Segher Boessenkool

combine: Fix various shortcomings in make_more_copies (PR87701, PR87780)

This rewrites most of make_more_copies, in the process fixing a few PRs
and some other bugs, and working around a few target problems.  Certain
notes turn out to actually change the meaning of the RTL, so we cannot
drop them; and i386 takes subregs of hard regs.


	PR rtl-optimization/87701
	PR rtl-optimization/87780
	* combine.c (make_more_copies): Rewrite.

From-SVN: r265582
parent 6679694a
2018-10-29 Segher Boessenkool <segher@kernel.crashing.org>
PR rtl-optimization/87701
PR rtl-optimization/87780
* combine.c (make_more_copies): Rewrite.
2018-10-28 Kugan Vivekanandarajah <kuganv@linaro.org> 2018-10-28 Kugan Vivekanandarajah <kuganv@linaro.org>
* doc/generic.texi (ABSU_EXPR): Document. * doc/generic.texi (ABSU_EXPR): Document.
...@@ -14956,25 +14956,20 @@ make_more_copies (void) ...@@ -14956,25 +14956,20 @@ make_more_copies (void)
rtx set = single_set (insn); rtx set = single_set (insn);
if (!set) if (!set)
continue; continue;
rtx src = SET_SRC (set);
rtx dest = SET_DEST (set); rtx dest = SET_DEST (set);
if (dest == pc_rtx) if (dest == pc_rtx)
continue; continue;
if (GET_CODE (src) == SUBREG) rtx src = SET_SRC (set);
src = SUBREG_REG (src);
if (!(REG_P (src) && HARD_REGISTER_P (src))) if (!(REG_P (src) && HARD_REGISTER_P (src)))
continue; continue;
if (TEST_HARD_REG_BIT (fixed_reg_set, REGNO (src))) if (TEST_HARD_REG_BIT (fixed_reg_set, REGNO (src)))
continue; continue;
rtx new_reg = gen_reg_rtx (GET_MODE (dest)); rtx new_reg = gen_reg_rtx (GET_MODE (dest));
rtx_insn *insn1 = gen_move_insn (new_reg, src); rtx_insn *new_insn = gen_move_insn (new_reg, src);
rtx_insn *insn2 = gen_move_insn (dest, new_reg); SET_SRC (set) = new_reg;
emit_insn_after (insn1, insn); emit_insn_before (new_insn, insn);
emit_insn_after (insn2, insn1); df_insn_rescan (insn);
delete_insn (insn);
insn = insn2;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment