+2019-03-27 Jeff Law <law@redhat.com>
+
+
+ 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.
+
2019-03-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/89463
/* 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)))
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.
+2019-03-26 Jeff Law <law@redhat.com>
+
+ PR rtl-optimization/87761
+ PR rtl-optimization/89826
+ * gcc.c-torture/execute/pr89826.c: New test.
+
2019-03-27 Richard Biener <rguenther@suse.de>
* gcc.dg/torture/20190327-1.c: New testcase.
--- /dev/null
+typedef unsigned int u32;
+typedef unsigned long long u64;
+u64 a;
+u32 b;
+
+u64
+foo (u32 d)
+{
+ a -= d ? 0 : ~a;
+ return a + b;
+}
+
+int
+main (void)
+{
+ u64 x = foo (2);
+ if (x != 0)
+ __builtin_abort();
+ return 0;
+}
+