diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-12 17:22:03 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-12 17:22:03 +0000 |
commit | 4cde3e4d9fa9597256780846467d8b7398081005 (patch) | |
tree | 7fbe3e0f7976ee06071314aa3a4f0e6be24c17c5 /gcc/except.c | |
parent | b6391cbb365741ad900f86f61b10416612900f7a (diff) | |
download | gcc-4cde3e4d9fa9597256780846467d8b7398081005.tar.gz |
PR 17186, part deux
* 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
Diffstat (limited to 'gcc/except.c')
-rw-r--r-- | gcc/except.c | 21 |
1 files changed, 11 insertions, 10 deletions
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); } } |