aboutsummaryrefslogtreecommitdiff
path: root/gcc/regcprop.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2019-03-27 10:18:06 -0600
committerJeff Law <law@gcc.gnu.org>2019-03-27 10:18:06 -0600
commit52295c2de4adcd0f5a6ee9b5a4f57cd156182cf0 (patch)
tree28016165b85dfcc8719ec17c7574c11867044d6f /gcc/regcprop.c
parentce4609958f8db5cd64ec1c3bec624a36d8b35812 (diff)
downloadgcc-52295c2de4adcd0f5a6ee9b5a4f57cd156182cf0.zip
gcc-52295c2de4adcd0f5a6ee9b5a4f57cd156182cf0.tar.gz
gcc-52295c2de4adcd0f5a6ee9b5a4f57cd156182cf0.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 PR rtl-optimization/89826 * regcprop.c (copyprop_hardreg_forward_1): Move may_trap_p test slightly later. (pass_cprop_hardreg::execute): Call df_analyze after adding the note problem to get REG_DEAD/REG_UNUSED notes updated. PR rtl-optimization/87761 PR rtl-optimization/89826 * gcc.c-torture/execute/pr89826.c: New test. From-SVN: r269967
Diffstat (limited to 'gcc/regcprop.c')
-rw-r--r--gcc/regcprop.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/regcprop.c b/gcc/regcprop.c
index 8ca523f..3efe21f 100644
--- a/gcc/regcprop.c
+++ b/gcc/regcprop.c
@@ -800,9 +800,9 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
/* Detect obviously dead sets (via REG_UNUSED notes) and remove them. */
if (set
- && !may_trap_p (set)
&& !RTX_FRAME_RELATED_P (insn)
&& INSN_P (insn)
+ && !may_trap_p (set)
&& find_reg_note (insn, REG_UNUSED, SET_DEST (set))
&& !side_effects_p (SET_SRC (set))
&& !side_effects_p (SET_DEST (set)))
@@ -1293,7 +1293,10 @@ pass_cprop_hardreg::execute (function *fun)
auto_sbitmap visited (last_basic_block_for_fn (fun));
bitmap_clear (visited);
+ /* We need accurate notes. Earlier passes such as if-conversion may
+ leave notes in an inconsistent state. */
df_note_add_problem ();
+ df_analyze ();
/* It is tempting to set DF_LR_RUN_DCE, but DCE may choose to delete
an insn and this pass would not have visibility into the removal.