except.c (expand_fixup_region_end): Make sure outer context labels are not issued...
authorAndrew MacLeod <amacleod@cygnus.com>
Thu, 5 Nov 1998 05:34:01 +0000 (05:34 +0000)
committerAndrew Macleod <amacleod@gcc.gnu.org>
Thu, 5 Nov 1998 05:34:01 +0000 (05:34 +0000)
Thu Nov  5 07:57:45 EST 1998  Andrew MacLeod  <amacleod@cygnus.com>
      * except.c (expand_fixup_region_end): Make sure outer context labels
      are not issued in an inner context during cleanups.

From-SVN: r23538

gcc/ChangeLog
gcc/except.c

index 818cff05da8a8521f8cddf9c5ea433bc7212709b..431f4b6837f655eb889ae1ee64a08ed0b32247d7 100644 (file)
@@ -1,3 +1,8 @@
+Thu Nov  5 07:57:45 EST 1998  Andrew MacLeod  <amacleod@cygnus.com>
+
+       * except.c (expand_fixup_region_end): Make sure outer context labels
+       are not issued in an inner context during cleanups.
+
 Thu Nov  5 04:03:06 1998  Richard Henderson  <rth@cygnus.com>
 
        * alpha.md (addsi3, subsi3): No new temporaries once cse is
index d07d6bf0d40eb86ff77f315bcae4f8f92bc80d38..6fa37f09718f1dbbca6811ffadd2160814fdfc96 100644 (file)
@@ -1476,6 +1476,7 @@ expand_fixup_region_end (cleanup)
      tree cleanup;
 {
   struct eh_node *node;
+  int dont_issue;
 
   if (! doing_eh (0) || exceptions_via_longjmp)
     return;
@@ -1488,10 +1489,31 @@ expand_fixup_region_end (cleanup)
   if (node == 0)
     abort ();
 
+  /* If the outer context label has not been issued yet, we don't want
+     to issue it as a part of this region, unless this is the
+     correct region for the outer context. If we did, then the label for
+     the outer context will be WITHIN the begin/end labels, 
+     and we could get an infinte loop when it tried to rethrow, or just
+     generally incorrect execution following a throw. */
+
+  dont_issue = ((INSN_UID (node->entry->outer_context) == 0) 
+            && (ehstack.top->entry != node->entry));
+
   ehstack.top->entry->outer_context = node->entry->outer_context;
 
+  /* Since we are rethrowing to the OUTER region, we know we don't need
+     a jump around sequence for this region, so we'll pretend the outer 
+     context label has been issued by setting INSN_UID to 1, then clearing
+     it again afterwards. */
+
+  if (dont_issue)
+    INSN_UID (node->entry->outer_context) = 1;
+
   /* Just rethrow.  size_zero_node is just a NOP.  */
   expand_eh_region_end (size_zero_node);
+
+  if (dont_issue)
+    INSN_UID (node->entry->outer_context) = 0;
 }
 
 /* If we are using the setjmp/longjmp EH codegen method, we emit a