diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e58453812f1..5feeef00f7a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-02-11 Geoff Keating + + * function.c (thread_prologue_and_epilogue_insns): Don't insert + a RETURN insn into a block which already ends with a jump. + 2000-02-11 Geoff Keating * haifa-sched.c (BUF_LEN): Increase a lot. diff --git a/gcc/function.c b/gcc/function.c index 117074287f6..dd4bcb9d089 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_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; } - - /* 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); goto epilogue_done; } #endif