cfgexpand.c (construct_exit_block): Don't disturb end of last BB.
* cfgexpand.c (construct_exit_block): Don't disturb end of last BB. * rtl.texi (NOTE_INSN_FUNCTION_END): Remove. * final.c (final_scan_insn): Don't scan NOTE_INSN_FUNCTION_END. * insn-notes.def (FUNCTION_END): Remove. * jump.c (delete_related_insns): Don't worry about FUNCTION_END. (redicect_jump_2): Don't accept -1 parameter to remove FUNCTION_END note. * ifcvt.c (dead_or_predictable): Update call of redirect_jump_2. * function.c (expand_function_end): Don't emit NOTE_INSN_FUNCTION_END * cfglayout.c (duplicate_insn_chain): Don't worry about NOTE_FUNCTION_END. From-SVN: r119250
This commit is contained in:
parent
2505a3f233
commit
071a42f958
@ -1,3 +1,17 @@
|
||||
2006-11-27 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* cfgexpand.c (construct_exit_block): Don't disturb end of last BB.
|
||||
* rtl.texi (NOTE_INSN_FUNCTION_END): Remove.
|
||||
* final.c (final_scan_insn): Don't scan NOTE_INSN_FUNCTION_END.
|
||||
* insn-notes.def (FUNCTION_END): Remove.
|
||||
* jump.c (delete_related_insns): Don't worry about FUNCTION_END.
|
||||
(redicect_jump_2): Don't accept -1 parameter to remove FUNCTION_END
|
||||
note.
|
||||
* ifcvt.c (dead_or_predictable): Update call of redirect_jump_2.
|
||||
* function.c (expand_function_end): Don't emit NOTE_INSN_FUNCTION_END
|
||||
* cfglayout.c (duplicate_insn_chain): Don't worry about
|
||||
NOTE_FUNCTION_END.
|
||||
|
||||
2006-11-27 Richard Guenther <rguenther@suse.de>
|
||||
Zdenek Dvorak <dvorakz@suse.cz>
|
||||
|
||||
|
@ -1465,6 +1465,7 @@ construct_exit_block (void)
|
||||
edge e, e2;
|
||||
unsigned ix;
|
||||
edge_iterator ei;
|
||||
rtx orig_end = BB_END (EXIT_BLOCK_PTR->prev_bb);
|
||||
|
||||
/* Make sure the locus is set to the end of the function, so that
|
||||
epilogue line numbers and warnings are set properly. */
|
||||
@ -1484,6 +1485,9 @@ construct_exit_block (void)
|
||||
end = get_last_insn ();
|
||||
if (head == end)
|
||||
return;
|
||||
/* While emitting the function end we could move end of the last basic block.
|
||||
*/
|
||||
BB_END (EXIT_BLOCK_PTR->prev_bb) = orig_end;
|
||||
while (NEXT_INSN (head) && NOTE_P (NEXT_INSN (head)))
|
||||
head = NEXT_INSN (head);
|
||||
exit_block = create_basic_block (NEXT_INSN (head), end,
|
||||
|
@ -987,7 +987,6 @@ duplicate_insn_chain (rtx from, rtx to)
|
||||
case NOTE_INSN_DELETED_LABEL:
|
||||
/* No problem to strip these. */
|
||||
case NOTE_INSN_EPILOGUE_BEG:
|
||||
case NOTE_INSN_FUNCTION_END:
|
||||
/* Debug code expect these notes to exist just once.
|
||||
Keep them in the master copy.
|
||||
??? It probably makes more sense to duplicate them for each
|
||||
|
@ -3178,13 +3178,6 @@ invariants.
|
||||
Appears at the start of the function body, after the function
|
||||
prologue.
|
||||
|
||||
@findex NOTE_INSN_FUNCTION_END
|
||||
@item NOTE_INSN_FUNCTION_END
|
||||
Appears near the end of the function body, just before the label that
|
||||
@code{return} statements jump to (on machine where a single instruction
|
||||
does not suffice for returning). This note may be deleted by jump
|
||||
optimization.
|
||||
|
||||
@end table
|
||||
|
||||
These codes are printed symbolically when they appear in debugging dumps.
|
||||
|
@ -4342,11 +4342,6 @@ expand_function_end (void)
|
||||
clear_pending_stack_adjust ();
|
||||
do_pending_stack_adjust ();
|
||||
|
||||
/* Mark the end of the function body.
|
||||
If control reaches this insn, the function can drop through
|
||||
without returning a value. */
|
||||
emit_note (NOTE_INSN_FUNCTION_END);
|
||||
|
||||
/* Output a linenumber for the end of the function.
|
||||
SDB depends on this. */
|
||||
force_next_line_note ();
|
||||
@ -5289,15 +5284,14 @@ epilogue_done:
|
||||
|
||||
/* Similarly, move any line notes that appear after the epilogue.
|
||||
There is no need, however, to be quite so anal about the existence
|
||||
of such a note. Also move the NOTE_INSN_FUNCTION_END and (possibly)
|
||||
of such a note. Also possibly move
|
||||
NOTE_INSN_FUNCTION_BEG notes, as those can be relevant for debug
|
||||
info generation. */
|
||||
for (insn = epilogue_end; insn; insn = next)
|
||||
{
|
||||
next = NEXT_INSN (insn);
|
||||
if (NOTE_P (insn)
|
||||
&& (NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG
|
||||
|| NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_END))
|
||||
&& (NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG))
|
||||
reorder_insns (insn, insn, PREV_INSN (epilogue_end));
|
||||
}
|
||||
}
|
||||
|
@ -3773,7 +3773,7 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb,
|
||||
|
||||
if (other_bb != new_dest)
|
||||
{
|
||||
redirect_jump_2 (jump, old_dest, new_label, -1, reversep);
|
||||
redirect_jump_2 (jump, old_dest, new_label, 0, reversep);
|
||||
|
||||
redirect_edge_succ (BRANCH_EDGE (test_bb), new_dest);
|
||||
if (reversep)
|
||||
|
@ -48,13 +48,6 @@ INSN_NOTE (BLOCK_END)
|
||||
their homes, etc. */
|
||||
INSN_NOTE (FUNCTION_BEG)
|
||||
|
||||
/* This kind of note is generated at the end of the function body,
|
||||
just before the return insn or return label. In an optimizing
|
||||
compilation it is deleted by the first jump optimization, after
|
||||
enabling that optimizer to determine whether control can fall
|
||||
off the end of the function body without a return statement. */
|
||||
INSN_NOTE (FUNCTION_END)
|
||||
|
||||
/* This marks the point immediately after the last prologue insn. */
|
||||
INSN_NOTE (PROLOGUE_END)
|
||||
|
||||
|
19
gcc/jump.c
19
gcc/jump.c
@ -1467,8 +1467,7 @@ delete_related_insns (rtx insn)
|
||||
while (next)
|
||||
{
|
||||
code = GET_CODE (next);
|
||||
if (code == NOTE
|
||||
&& NOTE_LINE_NUMBER (next) != NOTE_INSN_FUNCTION_END)
|
||||
if (code == NOTE)
|
||||
next = NEXT_INSN (next);
|
||||
/* Keep going past other deleted labels to delete what follows. */
|
||||
else if (code == CODE_LABEL && INSN_DELETED_P (next))
|
||||
@ -1631,8 +1630,7 @@ redirect_jump (rtx jump, rtx nlabel, int delete_unused)
|
||||
}
|
||||
|
||||
/* Fix up JUMP_LABEL and label ref counts after OLABEL has been replaced with
|
||||
NLABEL in JUMP. If DELETE_UNUSED is non-negative, copy a
|
||||
NOTE_INSN_FUNCTION_END found after OLABEL to the place after NLABEL.
|
||||
NLABEL in JUMP.
|
||||
If DELETE_UNUSED is positive, delete related insn to OLABEL if its ref
|
||||
count has dropped to zero. */
|
||||
void
|
||||
@ -1641,6 +1639,10 @@ redirect_jump_2 (rtx jump, rtx olabel, rtx nlabel, int delete_unused,
|
||||
{
|
||||
rtx note;
|
||||
|
||||
/* negative DELETE_UNUSED used to be used to signalize behaviour on
|
||||
moving FUNCTION_END note. Just sanity check that no user still worry
|
||||
about this. */
|
||||
gcc_assert (delete_unused >= 0);
|
||||
JUMP_LABEL (jump) = nlabel;
|
||||
if (nlabel)
|
||||
++LABEL_NUSES (nlabel);
|
||||
@ -1657,15 +1659,6 @@ redirect_jump_2 (rtx jump, rtx olabel, rtx nlabel, int delete_unused,
|
||||
}
|
||||
}
|
||||
|
||||
/* If we're eliding the jump over exception cleanups at the end of a
|
||||
function, move the function end note so that -Wreturn-type works. */
|
||||
if (olabel && nlabel
|
||||
&& NEXT_INSN (olabel)
|
||||
&& NOTE_P (NEXT_INSN (olabel))
|
||||
&& NOTE_LINE_NUMBER (NEXT_INSN (olabel)) == NOTE_INSN_FUNCTION_END
|
||||
&& delete_unused >= 0)
|
||||
emit_note_after (NOTE_INSN_FUNCTION_END, nlabel);
|
||||
|
||||
if (olabel && --LABEL_NUSES (olabel) == 0 && delete_unused > 0
|
||||
/* Undefined labels will remain outside the insn stream. */
|
||||
&& INSN_UID (olabel))
|
||||
|
Loading…
Reference in New Issue
Block a user