Commit 4c33221c by Ulrich Weigand Committed by Ulrich Weigand

function.c (expand_function_end): Do not emit a jump to the "naked" return label…

function.c (expand_function_end): Do not emit a jump to the "naked" return label for fall-through returns.

	* function.c (expand_function_end): Do not emit a jump to the "naked"
	return label for fall-through returns.
	* except.c (sjlj_emit_function_exit): Always place the call to the
	unregister function at the location installed by expand_function_end.

From-SVN: r146570
parent 9925bce0
2009-04-22 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* function.c (expand_function_end): Do not emit a jump to the "naked"
return label for fall-through returns.
* except.c (sjlj_emit_function_exit): Always place the call to the
unregister function at the location installed by expand_function_end.
2009-04-22 Richard Guenther <rguenther@suse.de> 2009-04-22 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39845 PR tree-optimization/39845
......
...@@ -1968,9 +1968,7 @@ sjlj_emit_function_exit_after (rtx after) ...@@ -1968,9 +1968,7 @@ sjlj_emit_function_exit_after (rtx after)
static void static void
sjlj_emit_function_exit (void) sjlj_emit_function_exit (void)
{ {
rtx seq; rtx seq, insn;
edge e;
edge_iterator ei;
start_sequence (); start_sequence ();
...@@ -1984,31 +1982,11 @@ sjlj_emit_function_exit (void) ...@@ -1984,31 +1982,11 @@ sjlj_emit_function_exit (void)
post-dominates all can_throw_internal instructions. This is post-dominates all can_throw_internal instructions. This is
the last possible moment. */ the last possible moment. */
FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds) insn = crtl->eh.sjlj_exit_after;
if (e->flags & EDGE_FALLTHRU) if (LABEL_P (insn))
break; insn = NEXT_INSN (insn);
if (e)
{
rtx insn;
/* Figure out whether the place we are supposed to insert libcall emit_insn_after (seq, insn);
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 = BB_HEAD (e->src); ; insn = NEXT_INSN (insn))
{
if (insn == crtl->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);
}
} }
static void static void
......
...@@ -4804,7 +4804,6 @@ expand_function_end (void) ...@@ -4804,7 +4804,6 @@ expand_function_end (void)
start_sequence (); start_sequence ();
clobber_return_register (); clobber_return_register ();
expand_naked_return ();
seq = get_insns (); seq = get_insns ();
end_sequence (); end_sequence ();
...@@ -4812,7 +4811,8 @@ expand_function_end (void) ...@@ -4812,7 +4811,8 @@ expand_function_end (void)
} }
/* Output the label for the naked return from the function. */ /* Output the label for the naked return from the function. */
emit_label (naked_return_label); if (naked_return_label)
emit_label (naked_return_label);
/* @@@ This is a kludge. We want to ensure that instructions that /* @@@ This is a kludge. We want to ensure that instructions that
may trap are not moved into the epilogue by scheduling, because may trap are not moved into the epilogue by scheduling, because
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment