aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2018-10-29 08:36:45 +0100
committerSegher Boessenkool <segher@gcc.gnu.org>2018-10-29 08:36:45 +0100
commitaef7647f4a0a5a344ca7c3b5e2a9f18123949411 (patch)
treeba4685bfb0dc73e16e3d48106196d77812c10b34 /gcc
parent6679694ac9a9b1103d0697a660554cdd1febf68a (diff)
downloadgcc-aef7647f4a0a5a344ca7c3b5e2a9f18123949411.zip
gcc-aef7647f4a0a5a344ca7c3b5e2a9f18123949411.tar.gz
gcc-aef7647f4a0a5a344ca7c3b5e2a9f18123949411.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/combine.c15
2 files changed, 11 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e1b641f..0dd2c51 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+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>
* doc/generic.texi (ABSU_EXPR): Document.
diff --git a/gcc/combine.c b/gcc/combine.c
index 2b93328..3e20428 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -14956,25 +14956,20 @@ make_more_copies (void)
rtx set = single_set (insn);
if (!set)
continue;
- rtx src = SET_SRC (set);
rtx dest = SET_DEST (set);
if (dest == pc_rtx)
continue;
- if (GET_CODE (src) == SUBREG)
- src = SUBREG_REG (src);
+ rtx src = SET_SRC (set);
if (!(REG_P (src) && HARD_REGISTER_P (src)))
continue;
if (TEST_HARD_REG_BIT (fixed_reg_set, REGNO (src)))
continue;
rtx 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);
- emit_insn_after (insn2, insn1);
- delete_insn (insn);
-
- insn = insn2;
+ rtx_insn *new_insn = gen_move_insn (new_reg, src);
+ SET_SRC (set) = new_reg;
+ emit_insn_before (new_insn, insn);
+ df_insn_rescan (insn);
}
}
}