aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2019-02-26 10:08:06 -0700
committerJeff Law <law@gcc.gnu.org>2019-02-26 10:08:06 -0700
commitf73675e3c7503d6d48ea5ac29cd9b5e9d007668f (patch)
tree27dca3a9798238978aeb505c5e6945a926edb54e /gcc
parent067aef033f3a9ad971fc75ce0631c500de0f0423 (diff)
downloadgcc-f73675e3c7503d6d48ea5ac29cd9b5e9d007668f.zip
gcc-f73675e3c7503d6d48ea5ac29cd9b5e9d007668f.tar.gz
gcc-f73675e3c7503d6d48ea5ac29cd9b5e9d007668f.tar.bz2
re PR rtl-optimization/87761 ([MIPS] New FAIL: gcc.target/mips/fix-r4000-10.c -O1 start with r265398)
PR rtl-optimization/87761 * regcprop.c (copyprop_hardreg_forward_1): Use REG_UNUSED notes to detect obviously dead insns and delete them. From-SVN: r269218
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/regcprop.c16
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c4260af..92a90bc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2019-02-26 Jeff Law <law@redhat.com>
+
+ PR rtl-optimization/87761
+ * regcprop.c (copyprop_hardreg_forward_1): Use REG_UNUSED notes to
+ detect obviously dead insns and delete them.
+
2019-02-26 Richard Biener <rguenther@suse.de>
PR tree-optimization/89505
diff --git a/gcc/regcprop.c b/gcc/regcprop.c
index e6bdeb0..926df40 100644
--- a/gcc/regcprop.c
+++ b/gcc/regcprop.c
@@ -798,6 +798,22 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
}
}
+ /* Detect obviously dead sets (via REG_UNUSED notes) and remove them. */
+ if (set
+ && INSN_P (insn)
+ && !may_trap_p (insn)
+ && find_reg_note (insn, REG_UNUSED, SET_DEST (set))
+ && !side_effects_p (SET_SRC (set))
+ && !side_effects_p (SET_DEST (set)))
+ {
+ bool last = insn == BB_END (bb);
+ delete_insn (insn);
+ if (last)
+ break;
+ continue;
+ }
+
+
extract_constrain_insn (insn);
preprocess_constraints (insn);
const operand_alternative *op_alt = which_op_alt ();