]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
function.c (thread_prologue_and_epilogue_insns): Don't insert a RETURN insn into...
authorGeoff Keating <geoffk@cygnus.com>
Fri, 11 Feb 2000 19:31:55 +0000 (19:31 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Fri, 11 Feb 2000 19:31:55 +0000 (19:31 +0000)
* 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

gcc/ChangeLog
gcc/function.c

index e58453812f1ad0cd99b4f2148ac8ad53ccb28afe..5feeef00f7adbc8dd53fb56a7dfa611cafe42e69 100644 (file)
@@ -1,3 +1,8 @@
+2000-02-11  Geoff Keating  <geoffk@cygnus.com>
+
+       * 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  <geoffk@cygnus.com>
 
        * haifa-sched.c (BUF_LEN): Increase a lot.
index 117074287f679ca81b694e2a6bff9f3d481277d2..dd4bcb9d0894ccde60ce5f58b35134418bc8ee31 100644 (file)
@@ -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