diff options
author | Geoff Keating <geoffk@cygnus.com> | 2000-02-11 19:31:55 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2000-02-11 19:31:55 +0000 |
commit | 2dd8bc01663b0ff2c5dd586102dfe270b145fc45 (patch) | |
tree | 128746f73c3e2da8ea83b98082bd6be445d4bdb3 /gcc/function.c | |
parent | 3db18f599e3210129a417605fad494b271650dee (diff) | |
download | gcc-2dd8bc01663b0ff2c5dd586102dfe270b145fc45.zip gcc-2dd8bc01663b0ff2c5dd586102dfe270b145fc45.tar.gz gcc-2dd8bc01663b0ff2c5dd586102dfe270b145fc45.tar.bz2 |
function.c (thread_prologue_and_epilogue_insns): Don't insert a RETURN insn into a block which already ends with a jump.
* function.c (thread_prologue_and_epilogue_insns): Don't insert
a RETURN insn into a block which already ends with a jump.
From-SVN: r31928
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/gcc/function.c b/gcc/function.c index 1170742..dd4bcb9 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -6746,13 +6746,25 @@ thread_prologue_and_epilogue_insns (f) remove_edge (e); make_edge (NULL, bb, EXIT_BLOCK_PTR, 0); } - } - /* Emit a return insn for the exit fallthru block. Whether - this is still reachable will be determined later. */ + /* Emit a return insn for the exit fallthru block. Whether + this is still reachable will be determined later. */ - emit_barrier_after (last->end); - emit_return_into_block (last); + emit_barrier_after (last->end); + emit_return_into_block (last); + } + else + { + /* The exit block wasn't empty. We have to use insert_insn_on_edge, + as it may be the exit block can go elsewhere as well + as exiting. */ + start_sequence (); + emit_jump_insn (gen_return ()); + seq = gen_sequence (); + end_sequence (); + insert_insn_on_edge (seq, e); + insertted = 1; + } goto epilogue_done; } #endif |