* cfgcleanup.c (try_optimize_cfg): Make sure merge_blocks doesn't
merge bb with itself.
* gcc.c-torture/compile/
20020605-1.c: New test.
From-SVN: r54456
+2002-06-10 Jakub Jelinek <jakub@redhat.com>
+
+ * cfgcleanup.c (try_optimize_cfg): Make sure merge_blocks doesn't
+ merge bb with itself.
+
2002-06-10 Richard Henderson <rth@redhat.com>
* config/alpha/alpha.md (builtin_zap): Fix thinkos expanding mask.
&& !(s->flags & EDGE_COMPLEX)
&& (c = s->dest) != EXIT_BLOCK_PTR
&& c->pred->pred_next == NULL
+ && b != c
/* If the jump insn has side effects,
we can't kill the edge. */
&& (GET_CODE (b->end) != JUMP_INSN
+2002-06-10 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/compile/20020605-1.c: New test.
+
2002-06-07 Roger Sayle <roger@eyesopen.com>
* gcc.dg/20020607-2.c: New test case.
--- /dev/null
+/* This testcase caused on IA-32 -O2 endless loop in
+ merge_blocks when trying to merge a basic block
+ with itself. */
+
+void f (void)
+{
+ char *c;
+ do
+ {
+ if (c)
+ break;
+ }
+ while (1);
+ if (!c)
+ while (1)
+ f ();
+}