diff options
author | Richard Henderson <rth@cygnus.com> | 2000-05-12 09:26:15 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2000-05-12 09:26:15 -0700 |
commit | be1bb652637d5d8785993a4cd197d989dc4b5260 (patch) | |
tree | d0c01aedfa0c100dbc8cf6e908311acdea960127 /gcc/jump.c | |
parent | fb0f12c9326308579f89b0961681ffdb85288228 (diff) | |
download | gcc-be1bb652637d5d8785993a4cd197d989dc4b5260.zip gcc-be1bb652637d5d8785993a4cd197d989dc4b5260.tar.gz gcc-be1bb652637d5d8785993a4cd197d989dc4b5260.tar.bz2 |
Makefile.in (final.o): Depend on BASIC_BLOCK_H.
* Makefile.in (final.o): Depend on BASIC_BLOCK_H.
* final.c (final_end_function): Use app_disable. Rearrange note
handling into a switch. Emit deleted labels.
(output_asm_label): Generate label strings for deleted labels.
* flow.c (tail_recursion_label_list): New.
(find_basic_blocks_1): Set label_value_list directly. Collect list
of tail recursion labels from call_placeholders. Don't add deleted
labels to the label value list.
(cleanup_cfg): Use free_EXPR_LIST_list.
(flow_delete_insn_chain): Turn non-removable labels into notes.
(flow_delete_block): Don't disable deleting the block because of
a non-removable label.
(tail_recursion_label_p): New.
(merge_blocks_move_predecessor_nojumps): Don't disable the merge
because of a label.
(merge_blocks_move_successor_nojumps): Likewise. Also move a
jump table.
(merge_blocks): Disable a merge because of tail recursion labels.
* ifcvt.c (merge_if_block): Don't disable a merge because of a label.
Use a more accurate measure of not merging the join block.
(find_if_block): Don't disable conversion because of a label.
(find_if_case_1, find_if_case_2): Likewise.
* jump.c (duplicate_loop_exit_test): Preserve the kind of list
element when copying.
(squeeze_notes): Also leave EH notes.
(mark_jump_label): Ignore deleted labels. Use an INSN_LIST for
REG_LABEL notes.
(delete_insn): Preserve LABEL_NAME in NOTE_SOURCE_FILE when
deleting a label.
* print-rtl.c (print_rtx): Print NOTE_SOURCE_FILE for
NOTE_INSN_DELETED_LABEL. Print `[# deleted]' for a label_ref
referring to a deleted label. Convert tail handling to a switch.
* rtl.def (CODE_LABEL): Rearrange elements to be compatible with NOTE
for NOTE_INSN_DELETED_LABEL.
(NOTE): Fix commentary.
* rtl.h (REG_LABEL): Update commentary wrt INSN_LIST.
(REG_CC_SETTER, REG_CC_USER, REG_LIBCALL): Likewise.
(CODE_LABEL_NUMBER, LABEL_NAME): Update index.
(LABEL_NUSES, LABEL_REFS): Likewise.
* unroll.c (copy_loop_body): Don't copy NOTE_INSN_DELETED_LABEL.
From-SVN: r33876
Diffstat (limited to 'gcc/jump.c')
-rw-r--r-- | gcc/jump.c | 36 |
1 files changed, 27 insertions, 9 deletions
@@ -1262,10 +1262,19 @@ duplicate_loop_exit_test (loop_start) make them. */ for (link = REG_NOTES (insn); link; link = XEXP (link, 1)) if (REG_NOTE_KIND (link) != REG_LABEL) - REG_NOTES (copy) - = copy_insn_1 (gen_rtx_EXPR_LIST (REG_NOTE_KIND (link), - XEXP (link, 0), - REG_NOTES (copy))); + { + if (GET_CODE (link) == EXPR_LIST) + REG_NOTES (copy) + = copy_insn_1 (gen_rtx_EXPR_LIST (REG_NOTE_KIND (link), + XEXP (link, 0), + REG_NOTES (copy))); + else + REG_NOTES (copy) + = copy_insn_1 (gen_rtx_INSN_LIST (REG_NOTE_KIND (link), + XEXP (link, 0), + REG_NOTES (copy))); + } + if (reg_map && REG_NOTES (copy)) replace_regs (REG_NOTES (copy), reg_map, max_reg, 1); break; @@ -1345,8 +1354,8 @@ duplicate_loop_exit_test (loop_start) return 1; } -/* Move all block-beg, block-end, loop-beg, loop-cont, loop-vtop, and - loop-end notes between START and END out before START. Assume that +/* Move all block-beg, block-end, loop-beg, loop-cont, loop-vtop, loop-end, + eh-beg, eh-end notes between START and END out before START. Assume that END is not such a note. START may be such a note. Returns the value of the new starting insn, which may be different if the original start was such a note. */ @@ -1367,7 +1376,9 @@ squeeze_notes (start, end) || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_CONT - || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_VTOP)) + || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_VTOP + || NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG + || NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END)) { if (insn == start) start = next; @@ -2389,6 +2400,12 @@ mark_jump_label (x, insn, cross_jump, in_mem) rtx note; rtx next; + /* Ignore remaining references to unreachable labels that + have been deleted. */ + if (GET_CODE (label) == NOTE + && NOTE_LINE_NUMBER (label) == NOTE_INSN_DELETED_LABEL) + break; + if (GET_CODE (label) != CODE_LABEL) abort (); @@ -2449,7 +2466,7 @@ mark_jump_label (x, insn, cross_jump, in_mem) is no longer valid because of the more accurate cfg we build in find_basic_blocks -- it no longer pessimizes code when it finds a REG_LABEL note. */ - REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_LABEL, label, + REG_NOTES (insn) = gen_rtx_INSN_LIST (REG_LABEL, label, REG_NOTES (insn)); } } @@ -2755,9 +2772,10 @@ delete_insn (insn) dont_really_delete = 1; else if (! dont_really_delete) { + const char *name = LABEL_NAME (insn); PUT_CODE (insn, NOTE); NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED_LABEL; - NOTE_SOURCE_FILE (insn) = 0; + NOTE_SOURCE_FILE (insn) = name; dont_really_delete = 1; } } |