diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-11-27 15:07:10 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-11-27 15:07:10 +0000 |
commit | 737251e7585f75e2730d497bf244ab6af5c3f26c (patch) | |
tree | 3174477a8d1b3916f3d18072026872cc7db41e00 | |
parent | 22c2f6bdda9682df91ef7761d4b77c01e8bbcd37 (diff) | |
download | gcc-737251e7585f75e2730d497bf244ab6af5c3f26c.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119250 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/cfgexpand.c | 4 | ||||
-rw-r--r-- | gcc/cfglayout.c | 1 | ||||
-rw-r--r-- | gcc/doc/rtl.texi | 7 | ||||
-rw-r--r-- | gcc/function.c | 10 | ||||
-rw-r--r-- | gcc/ifcvt.c | 2 | ||||
-rw-r--r-- | gcc/insn-notes.def | 7 | ||||
-rw-r--r-- | gcc/jump.c | 19 |
8 files changed, 27 insertions, 37 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4d4a97d1428..e40e259fe65 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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> diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 76f603f7820..d0a560ec00b 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -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, diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c index cf76cdb4125..15bde05de01 100644 --- a/gcc/cfglayout.c +++ b/gcc/cfglayout.c @@ -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 diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi index d97b2b327ef..2d4644d5873 100644 --- a/gcc/doc/rtl.texi +++ b/gcc/doc/rtl.texi @@ -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. diff --git a/gcc/function.c b/gcc/function.c index 78dfe81a7fb..da93fa2af6e 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -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)); } } diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 602836096c5..b869092ed77 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -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) diff --git a/gcc/insn-notes.def b/gcc/insn-notes.def index 9f942bb354d..b93d6c2f482 100644 --- a/gcc/insn-notes.def +++ b/gcc/insn-notes.def @@ -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) diff --git a/gcc/jump.c b/gcc/jump.c index 127e8a800c3..807f2c6f7d6 100644 --- a/gcc/jump.c +++ b/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)) |