2007-02-13 Alexandre Oliva <aoliva@redhat.com>
* reload1.c (fixup_abnormal_edges): Backport relevant portion of
fix for PR rtl-optimization/23601.
* g++.dg/eh/bz226706.C: New
--- gcc/reload1.c 2006-10-13 04:32:14.000000000 -0300
+++ gcc/reload1.c 2007-02-13 03:22:08.000000000 -0200
@@ -9524,7 +9524,10 @@ fixup_abnormal_edges ()
&& insn != bb->head)
insn = PREV_INSN (insn);
if (GET_CODE (insn) != CALL_INSN && !can_throw_internal (insn))
- abort ();
+ {
+ purge_dead_edges (bb);
+ continue;
+ }
bb->end = insn;
inserted = true;
insn = NEXT_INSN (insn);
--- gcc/testsuite/g++.dg/eh/bz226706.C 1970-01-01 00:00:00.000000000 +0000
+++ gcc/testsuite/g++.dg/eh/bz226706.C 2007-02-13 03:30:16.000000000 -0200
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fnon-call-exceptions -fPIC -O2" } */
+
+void foo() {
+ try {
+ float y = 10;
+ while (y > 0) {
+ double z = (y / 10);
+ y = z;
+ }
+ }
+ catch (...) {}
+}