PR tree-optimization/71661
* tree-cfgcleanup.c (remove_forwarder_block_with_phi): Handle case when
removal of a forwarder exposes a new natural loop.
PR tree-optimization/71661
* gcc.dg/tree-ssa/pr71661.c: New test.
From-SVN: r240836
+2016-10-05 Jeff Law <law@redhat.com>
+
+ PR tree-optimization/71661
+ * tree-cfgcleanup.c (remove_forwarder_block_with_phi): Handle case when
+ removal of a forwarder exposes a new natural loop.
+
2016-10-06 Uros Bizjak <ubizjak@gmail.com>
* config/i386/sse.md (andnot<mode>3): Add FALLTHRU comments.
+2016-10-06 Jeff Law <law@redhat.com>
+
+ PR tree-optimization/71661
+ * gcc.dg/tree-ssa/pr71661.c: New test.
+
2016-10-06 Richard Biener <rguenther@suse.de>
PR tree-optimization/77855
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O3 -fdisable-tree-ethread" } */
+
+extern void exit (int);
+
+int a, b;
+
+void
+fn1 ()
+{
+ unsigned c = 0;
+ int d;
+ b = a;
+ if (a < 0)
+ goto L1;
+ for (; a < 1; a++)
+ d = 0;
+ for (; d < 2; d++)
+ {
+ for (c = 0; c < 3; c++)
+ L1:
+ a = 2;
+ }
+}
+
+int
+main ()
+{
+ fn1 ();
+ exit (0);
+}
if (dest == bb)
return false;
+ /* Removal of forwarders may expose new natural loops and thus
+ a block may turn into a loop header. */
+ if (current_loops && bb_loop_header_p (bb))
+ return false;
+
/* If the destination block consists of a nonlocal label, do not
merge it. */
label = first_stmt (dest);