re PR middle-end/39651 (New cleanup test failures)
authorAdam Nemet <anemet@caviumnetworks.com>
Sun, 12 Apr 2009 19:36:50 +0000 (19:36 +0000)
committerAdam Nemet <nemet@gcc.gnu.org>
Sun, 12 Apr 2009 19:36:50 +0000 (19:36 +0000)
PR middle-end/39651
* except.c (can_throw_external): Look at each insn in a SEQUENCE
when deciding whether the whole SEQUENCE can throw.

From-SVN: r145986

gcc/ChangeLog
gcc/except.c

index cce9c47..04b6507 100644 (file)
@@ -1,3 +1,9 @@
+2009-04-12  Adam Nemet  <anemet@caviumnetworks.com>
+
+       PR middle-end/39651
+       * except.c (can_throw_external): Look at each insn in a SEQUENCE
+       when deciding whether the whole SEQUENCE can throw.
+
 2009-04-12  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/39740
index a0a81bc..889dd61 100644 (file)
@@ -2892,7 +2892,16 @@ can_throw_external (const_rtx insn)
 
   if (NONJUMP_INSN_P (insn)
       && GET_CODE (PATTERN (insn)) == SEQUENCE)
-    insn = XVECEXP (PATTERN (insn), 0, 0);
+    {
+      rtx seq = PATTERN (insn);
+      int i, n = XVECLEN (seq, 0);
+
+      for (i = 0; i < n; i++)
+       if (can_throw_external (XVECEXP (seq, 0, i)))
+         return true;
+
+      return false;
+    }
 
   note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
   if (!note)