+2016-02-26 Richard Biener <rguenther@suse.de>
+ Jeff Law <law@redhat.com>
+
+ PR tree-optimization/69740
+ * cfghooks.c (remove_edge): Request loop fixups if we delete
+ an edge that might turn an irreducible loop into a natural
+ loop.
+
2016-02-26 Martin Jambor <mjambor@suse.cz>
PR middle-end/69920
remove_edge (edge e)
{
if (current_loops != NULL)
- rescan_loop_exit (e, false, true);
+ {
+ rescan_loop_exit (e, false, true);
+
+ /* Removal of an edge inside an irreducible region or which leads
+ to an irreducible region can turn the region into a natural loop.
+ In that case, ask for the loop structure fixups.
+
+ FIXME: Note that LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS is not always
+ set, so always ask for fixups when removing an edge in that case. */
+ if (!loops_state_satisfies_p (LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS)
+ || (e->flags & EDGE_IRREDUCIBLE_LOOP)
+ || (e->dest->flags & BB_IRREDUCIBLE_LOOP))
+ loops_state_set (LOOPS_NEED_FIXUP);
+ }
/* This is probably not needed, but it doesn't hurt. */
/* FIXME: This should be called via a remove_edge hook. */
+2016-02-26 Richard Biener <rguenther@suse.de>
+ Jeff Law <law@redhat.com>
+
+ PR tree-optimization/69740
+ * gcc.c-torture/compile/pr69740-1.c: New test.
+ * gcc.c-torture/compile/pr69740-2.c: New test.
+
2016-02-26 Martin Jambor <mjambor@suse.cz>
PR middle-end/69920