From: Richard Henderson Date: Sun, 12 Sep 2004 17:22:03 +0000 (-0700) Subject: PR 17186, part deux X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f6a41d17646f19146749442cced240b927f88b8b;p=gcc.git PR 17186, part deux PR 17186, part deux * except.c (sjlj_emit_function_exit): Fix logic locating sjlj_exit_after in final block. From-SVN: r87394 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f9b548a830a..81f42f3cd26 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-09-12 Richard Henderson * common.opt: Remove flags -fmove-all-movables and diff --git a/gcc/except.c b/gcc/except.c index 9e3c06df18a..50eda2a0d0d 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -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); } }