* except.c (remove_unreachable_regions): Look thru CALL_PLACEHOLDER.
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 Mar 2004 23:19:51 +0000 (23:19 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 Mar 2004 23:19:51 +0000 (23:19 +0000)
* g++.dg/opt/eh1.C: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79350 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/except.c
gcc/testsuite/g++.dg/opt/eh1.C [new file with mode: 0644]

index 66813dd..7e39ad6 100644 (file)
@@ -1,3 +1,8 @@
+2004-03-11  Richard Henderson  <rth@redhat.com>
+
+       PR middle-end/14477
+       * except.c (remove_unreachable_regions): Look thru CALL_PLACEHOLDER.
+
 2004-03-11  Ulrich Weigand  <uweigand@de.ibm.com>
 
        PR target/14262
index 60edf82..809f653 100644 (file)
@@ -1048,7 +1048,18 @@ remove_unreachable_regions (rtx insns)
     }
 
   for (insn = insns; insn; insn = NEXT_INSN (insn))
-    reachable[uid_region_num[INSN_UID (insn)]] = true;
+    {
+      reachable[uid_region_num[INSN_UID (insn)]] = true;
+
+      if (GET_CODE (insn) == CALL_INSN
+         && GET_CODE (PATTERN (insn)) == CALL_PLACEHOLDER)
+       for (i = 0; i < 3; i++)
+         {
+           rtx sub = XEXP (PATTERN (insn), i);
+           for (; sub ; sub = NEXT_INSN (sub))
+             reachable[uid_region_num[INSN_UID (sub)]] = true;
+         }
+    }
 
   for (i = cfun->eh->last_region_number; i > 0; --i)
     {
diff --git a/gcc/testsuite/g++.dg/opt/eh1.C b/gcc/testsuite/g++.dg/opt/eh1.C
new file mode 100644 (file)
index 0000000..63a4d2e
--- /dev/null
@@ -0,0 +1,21 @@
+// PR middle-end/14477
+// { dg-do compile }
+// { dg-options "-O2 -fno-default-inline" }
+
+struct A
+{
+  A();
+};
+
+struct B
+{
+  B(const A*);
+};
+
+struct C
+{
+  B b;
+  C(int) : b(new A) {}
+};
+
+C c(0);