2019-08-30 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2019-01-16 David Malcolm <dmalcolm@redhat.com>
+
+ PR target/88861
+ * combine.c (delete_noop_moves): Convert to "bool" return,
+ returning true if any edges are eliminated.
+ (combine_instructions): Also return true if delete_noop_moves
+ returns true.
+
2019-02-08 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/89234
}
-/* Delete any insns that copy a register to itself. */
+/* Delete any insns that copy a register to itself.
+ Return true if the CFG was changed. */
-static void
+static bool
delete_noop_moves (void)
{
rtx_insn *insn, *next;
basic_block bb;
+ bool edges_deleted = false;
+
FOR_EACH_BB_FN (bb, cfun)
{
for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb)); insn = next)
if (dump_file)
fprintf (dump_file, "deleting noop move %d\n", INSN_UID (insn));
- delete_insn_and_edges (insn);
+ edges_deleted |= delete_insn_and_edges (insn);
}
}
}
+
+ return edges_deleted;
}
\f
/* Main entry point for combiner. F is the first insn of the function.
NREGS is the first unused pseudo-reg number.
- Return nonzero if the combiner has turned an indirect jump
- instruction into a direct jump. */
+ Return nonzero if the CFG was changed (e.g. if the combiner has
+ turned an indirect jump instruction into a direct jump). */
static int
combine_instructions (rtx_insn *f, unsigned int nregs)
{
default_rtl_profile ();
clear_bb_flags ();
new_direct_jump_p |= purge_all_dead_edges ();
- delete_noop_moves ();
+ new_direct_jump_p |= delete_noop_moves ();
/* Clean up. */
obstack_free (&insn_link_obstack, NULL);
2019-08-30 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2019-02-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/88861
+ * g++.dg/opt/pr89188.C: Include ../torture/pr88861.C.
+
+ 2019-01-16 David Malcolm <dmalcolm@redhat.com>
+
+ PR target/88861
+ * g++.dg/torture/pr88861.C: New test.
+
2019-02-08 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/89234
// { dg-do compile { target c++11 } }
// { dg-options "-Og -flive-range-shrinkage -fnon-call-exceptions" }
-struct Ax {
- int n, a[];
-};
-
-int i = 12345678;
-int main() {
- static Ax s{456, i};
- ((s.a[0]) ? (void)0 : (void)0);
-}
+#include "../torture/pr88861.C"