@@ -1539,8 +1539,7 @@ bypass_block (basic_block bb, rtx setcc,
/* The irreducible loops created by redirecting of edges entering the
loop from outside would decrease effectiveness of some of the
following optimizations, so prevent this. */
- if (may_be_loop_header
- && !(e->flags & EDGE_DFS_BACK))
+ if (may_be_loop_header)
{
ei_next (&ei);
continue;
@@ -0,0 +1,24 @@
+/* PR middle-end/54838 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-forward-propagate -ftracer" } */
+
+void bar (void);
+
+void
+foo (void *b, int *c)
+{
+again:
+ switch (*c)
+ {
+ case 1:
+ if (!b)
+ {
+ bar ();
+ return;
+ }
+ goto again;
+ case 3:
+ if (!b)
+ goto again;
+ }
+}