OSDN Git Service

PR 17186, part deux
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 12 Sep 2004 17:22:03 +0000 (17:22 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 12 Sep 2004 17:22:03 +0000 (17:22 +0000)
        * except.c (sjlj_emit_function_exit): Fix logic locating
        sjlj_exit_after in final block.

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

gcc/ChangeLog
gcc/except.c

index f9b548a..81f42f3 100644 (file)
@@ -1,3 +1,9 @@
+2004-09-12  Richard Henderson  <rth@redhat.com
+
+        PR 17186, part deux
+        * except.c (sjlj_emit_function_exit): Fix logic locating
+        sjlj_exit_after in final block.
+
 2004-09-12  Toon Moene  <toon@moene.indiv.nluug.nl>
 
        * common.opt: Remove flags -fmove-all-movables and
index 9e3c06d..50eda2a 100644 (file)
@@ -2042,18 +2042,19 @@ sjlj_emit_function_exit (void)
          is inside the last basic block or after it.  In the other case
          we need to emit to edge.  */
       gcc_assert (e->src->next_bb == EXIT_BLOCK_PTR);
-      for (insn = NEXT_INSN (BB_END (e->src)); insn; insn = NEXT_INSN (insn))
-       if (insn == cfun->eh->sjlj_exit_after)
-         break;
-      if (insn)
-       insert_insn_on_edge (seq, e);
-      else
+      for (insn = BB_HEAD (e->src); ; insn = NEXT_INSN (insn))
        {
-         insn = cfun->eh->sjlj_exit_after;
-         if (LABEL_P (insn))
-           insn = NEXT_INSN (insn);
-         emit_insn_after (seq, insn);
+         if (insn == cfun->eh->sjlj_exit_after)
+           {
+             if (LABEL_P (insn))
+               insn = NEXT_INSN (insn);
+             emit_insn_after (seq, insn);
+             return;
+           }
+         if (insn == BB_END (e->src))
+           break;
        }
+      insert_insn_on_edge (seq, e);
     }
 }