diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-30 21:25:52 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-30 21:25:52 +0000 |
commit | 0891f67c61dec2ba7f0c5af424821bea19d19d7f (patch) | |
tree | dae06d9ce92a27f5d915c142bf46cfdc29dea973 | |
parent | 4fed3f99b034309e255c9f820b40788458d2da70 (diff) | |
download | gcc-0891f67c61dec2ba7f0c5af424821bea19d19d7f.tar.gz |
PR debug/13974
* cfgrtl.c (try_redirect_by_replacing_jump,
force_nonfallthru_and_redirect, commit_one_edge_insertion,
cfg_layout_merge_blocks): Do not attach any line number information
to newly inserted instructions.
* emit-rtl.c (emit_insn*_before, emit_insn*_after): Rename to
emit_insn_*_noloc.
(emit_*insn_before, emit_insn*_after): New.
(emit_*insn_before_setloc, emit_*insn_after_setloc): Do not overwrite
existing locators.
* rtl.h (emit_*insn_before_noloc, emit_*insn_after_noloc): Declare.
(emit_*insn_before_sameloc, emit_*insn_after_sameloc): Kill.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88358 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/cfgrtl.c | 14 | ||||
-rw-r--r-- | gcc/emit-rtl.c | 147 | ||||
-rw-r--r-- | gcc/gcse.c | 8 | ||||
-rw-r--r-- | gcc/reload1.c | 22 | ||||
-rw-r--r-- | gcc/rtl.h | 19 | ||||
-rw-r--r-- | gcc/tree-ssa-pre.c | 1 |
7 files changed, 170 insertions, 56 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c658bc085a4..c3cf3a771dd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2004-09-30 Jan Hubicka <jh@suse.cz> + + PR debug/13974 + * cfgrtl.c (try_redirect_by_replacing_jump, + force_nonfallthru_and_redirect, commit_one_edge_insertion, + cfg_layout_merge_blocks): Do not attach any line number information + to newly inserted instructions. + * emit-rtl.c (emit_insn*_before, emit_insn*_after): Rename to + emit_insn_*_noloc. + (emit_*insn_before, emit_insn*_after): New. + (emit_*insn_before_setloc, emit_*insn_after_setloc): Do not overwrite + existing locators. + * rtl.h (emit_*insn_before_noloc, emit_*insn_after_noloc): Declare. + (emit_*insn_before_sameloc, emit_*insn_after_sameloc): Kill. + 2004-09-30 Ulrich Weigand <uweigand@de.ibm.com> * config/s390/s390-protos.h (s390_arg_frame_offset): Remove. diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index bba68819a80..67b55f4b79a 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -771,7 +771,7 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) rtx target_label = block_label (target); rtx barrier, label, table; - emit_jump_insn_after (gen_jump (target_label), insn); + emit_jump_insn_after_noloc (gen_jump (target_label), insn); JUMP_LABEL (BB_END (src)) = target_label; LABEL_NUSES (target_label)++; if (dump_file) @@ -1150,7 +1150,7 @@ force_nonfallthru_and_redirect (edge e, basic_block target) if (target == EXIT_BLOCK_PTR) { #ifdef HAVE_return - emit_jump_insn_after (gen_return (), BB_END (jump_block)); + emit_jump_insn_after_noloc (gen_return (), BB_END (jump_block)); #else gcc_unreachable (); #endif @@ -1158,7 +1158,7 @@ force_nonfallthru_and_redirect (edge e, basic_block target) else { rtx label = block_label (target); - emit_jump_insn_after (gen_jump (label), BB_END (jump_block)); + emit_jump_insn_after_noloc (gen_jump (label), BB_END (jump_block)); JUMP_LABEL (BB_END (jump_block)) = label; LABEL_NUSES (label)++; } @@ -1653,11 +1653,11 @@ commit_one_edge_insertion (edge e, int watch_calls) if (before) { - emit_insn_before (insns, before); + emit_insn_before_noloc (insns, before); last = prev_nonnote_insn (before); } else - last = emit_insn_after (insns, after); + last = emit_insn_after_noloc (insns, after); if (returnjump_p (last)) { @@ -2779,7 +2779,7 @@ cfg_layout_merge_blocks (basic_block a, basic_block b) { rtx first = BB_END (a), last; - last = emit_insn_after (b->rbi->header, BB_END (a)); + last = emit_insn_after_noloc (b->rbi->header, BB_END (a)); delete_insn_chain (NEXT_INSN (first), last); b->rbi->header = NULL; } @@ -2789,7 +2789,7 @@ cfg_layout_merge_blocks (basic_block a, basic_block b) { rtx first = unlink_insn_chain (BB_HEAD (b), BB_END (b)); - emit_insn_after (first, BB_END (a)); + emit_insn_after_noloc (first, BB_END (a)); /* Skip possible DELETED_LABEL insn. */ if (!NOTE_INSN_BASIC_BLOCK_P (first)) first = NEXT_INSN (first); diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 01d87764bda..2a152c525c0 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -3951,7 +3951,7 @@ remove_unnecessary_notes (void) /* Make X be output before the instruction BEFORE. */ rtx -emit_insn_before (rtx x, rtx before) +emit_insn_before_noloc (rtx x, rtx before) { rtx last = before; rtx insn; @@ -3998,7 +3998,7 @@ emit_insn_before (rtx x, rtx before) and output it before the instruction BEFORE. */ rtx -emit_jump_insn_before (rtx x, rtx before) +emit_jump_insn_before_noloc (rtx x, rtx before) { rtx insn, last = NULL_RTX; @@ -4041,7 +4041,7 @@ emit_jump_insn_before (rtx x, rtx before) and output it before the instruction BEFORE. */ rtx -emit_call_insn_before (rtx x, rtx before) +emit_call_insn_before_noloc (rtx x, rtx before) { rtx last = NULL_RTX, insn; @@ -4171,7 +4171,7 @@ emit_insn_after_1 (rtx first, rtx after) /* Make X be output after the insn AFTER. */ rtx -emit_insn_after (rtx x, rtx after) +emit_insn_after_noloc (rtx x, rtx after) { rtx last = after; @@ -4227,7 +4227,7 @@ emit_insn_after_with_line_notes (rtx x, rtx after, rtx from) and output it after the insn AFTER. */ rtx -emit_jump_insn_after (rtx x, rtx after) +emit_jump_insn_after_noloc (rtx x, rtx after) { rtx last; @@ -4263,7 +4263,7 @@ emit_jump_insn_after (rtx x, rtx after) and output it after the instruction AFTER. */ rtx -emit_call_insn_after (rtx x, rtx after) +emit_call_insn_after_noloc (rtx x, rtx after) { rtx last; @@ -4364,19 +4364,19 @@ emit_note_copy_after (rtx orig, rtx after) return note; } -/* Like emit_insn_after, but set INSN_LOCATOR according to SCOPE. */ +/* Like emit_insn_after_noloc, but set INSN_LOCATOR according to SCOPE. */ rtx emit_insn_after_setloc (rtx pattern, rtx after, int loc) { - rtx last = emit_insn_after (pattern, after); + rtx last = emit_insn_after_noloc (pattern, after); - if (pattern == NULL_RTX) + if (pattern == NULL_RTX || !loc) return last; after = NEXT_INSN (after); while (1) { - if (active_insn_p (after)) + if (active_insn_p (after) && !INSN_LOCATOR (after)) INSN_LOCATOR (after) = loc; if (after == last) break; @@ -4385,19 +4385,29 @@ emit_insn_after_setloc (rtx pattern, rtx after, int loc) return last; } -/* Like emit_jump_insn_after, but set INSN_LOCATOR according to SCOPE. */ +/* Like emit_insn_after_noloc, but set INSN_LOCATOR according to AFTER. */ +rtx +emit_insn_after (rtx pattern, rtx after) +{ + if (INSN_P (after)) + return emit_insn_after_setloc (pattern, after, INSN_LOCATOR (after)); + else + return emit_insn_after_noloc (pattern, after); +} + +/* Like emit_jump_insn_after_noloc, but set INSN_LOCATOR according to SCOPE. */ rtx emit_jump_insn_after_setloc (rtx pattern, rtx after, int loc) { - rtx last = emit_jump_insn_after (pattern, after); + rtx last = emit_jump_insn_after_noloc (pattern, after); - if (pattern == NULL_RTX) + if (pattern == NULL_RTX || !loc) return last; after = NEXT_INSN (after); while (1) { - if (active_insn_p (after)) + if (active_insn_p (after) && !INSN_LOCATOR (after)) INSN_LOCATOR (after) = loc; if (after == last) break; @@ -4406,19 +4416,29 @@ emit_jump_insn_after_setloc (rtx pattern, rtx after, int loc) return last; } -/* Like emit_call_insn_after, but set INSN_LOCATOR according to SCOPE. */ +/* Like emit_jump_insn_after_noloc, but set INSN_LOCATOR according to AFTER. */ +rtx +emit_jump_insn_after (rtx pattern, rtx after) +{ + if (INSN_P (after)) + return emit_jump_insn_after_setloc (pattern, after, INSN_LOCATOR (after)); + else + return emit_jump_insn_after_noloc (pattern, after); +} + +/* Like emit_call_insn_after_noloc, but set INSN_LOCATOR according to SCOPE. */ rtx emit_call_insn_after_setloc (rtx pattern, rtx after, int loc) { - rtx last = emit_call_insn_after (pattern, after); + rtx last = emit_call_insn_after_noloc (pattern, after); - if (pattern == NULL_RTX) + if (pattern == NULL_RTX || !loc) return last; after = NEXT_INSN (after); while (1) { - if (active_insn_p (after)) + if (active_insn_p (after) && !INSN_LOCATOR (after)) INSN_LOCATOR (after) = loc; if (after == last) break; @@ -4427,12 +4447,86 @@ emit_call_insn_after_setloc (rtx pattern, rtx after, int loc) return last; } -/* Like emit_insn_before, but set INSN_LOCATOR according to SCOPE. */ +/* Like emit_call_insn_after_noloc, but set INSN_LOCATOR according to AFTER. */ +rtx +emit_call_insn_after (rtx pattern, rtx after) +{ + if (INSN_P (after)) + return emit_call_insn_after_setloc (pattern, after, INSN_LOCATOR (after)); + else + return emit_call_insn_after_noloc (pattern, after); +} + +/* Like emit_insn_before_noloc, but set INSN_LOCATOR according to SCOPE. */ rtx emit_insn_before_setloc (rtx pattern, rtx before, int loc) { rtx first = PREV_INSN (before); - rtx last = emit_insn_before (pattern, before); + rtx last = emit_insn_before_noloc (pattern, before); + + if (pattern == NULL_RTX || !loc) + return last; + + first = NEXT_INSN (first); + while (1) + { + if (active_insn_p (first) && !INSN_LOCATOR (first)) + INSN_LOCATOR (first) = loc; + if (first == last) + break; + first = NEXT_INSN (first); + } + return last; +} + +/* Like emit_insn_before_noloc, but set INSN_LOCATOR according to BEFORE. */ +rtx +emit_insn_before (rtx pattern, rtx before) +{ + if (INSN_P (before)) + return emit_insn_before_setloc (pattern, before, INSN_LOCATOR (before)); + else + return emit_insn_before_noloc (pattern, before); +} + +/* like emit_insn_before_noloc, but set insn_locator according to scope. */ +rtx +emit_jump_insn_before_setloc (rtx pattern, rtx before, int loc) +{ + rtx first = PREV_INSN (before); + rtx last = emit_jump_insn_before_noloc (pattern, before); + + if (pattern == NULL_RTX) + return last; + + first = NEXT_INSN (first); + while (1) + { + if (active_insn_p (first) && !INSN_LOCATOR (first)) + INSN_LOCATOR (first) = loc; + if (first == last) + break; + first = NEXT_INSN (first); + } + return last; +} + +/* Like emit_jump_insn_before_noloc, but set INSN_LOCATOR according to BEFORE. */ +rtx +emit_jump_insn_before (rtx pattern, rtx before) +{ + if (INSN_P (before)) + return emit_jump_insn_before_setloc (pattern, before, INSN_LOCATOR (before)); + else + return emit_jump_insn_before_noloc (pattern, before); +} + +/* like emit_insn_before_noloc, but set insn_locator according to scope. */ +rtx +emit_call_insn_before_setloc (rtx pattern, rtx before, int loc) +{ + rtx first = PREV_INSN (before); + rtx last = emit_call_insn_before_noloc (pattern, before); if (pattern == NULL_RTX) return last; @@ -4440,7 +4534,7 @@ emit_insn_before_setloc (rtx pattern, rtx before, int loc) first = NEXT_INSN (first); while (1) { - if (active_insn_p (first)) + if (active_insn_p (first) && !INSN_LOCATOR (first)) INSN_LOCATOR (first) = loc; if (first == last) break; @@ -4448,6 +4542,17 @@ emit_insn_before_setloc (rtx pattern, rtx before, int loc) } return last; } + +/* like emit_call_insn_before_noloc, + but set insn_locator according to before. */ +rtx +emit_call_insn_before (rtx pattern, rtx before) +{ + if (INSN_P (before)) + return emit_call_insn_before_setloc (pattern, before, INSN_LOCATOR (before)); + else + return emit_call_insn_before_noloc (pattern, before); +} /* Take X and emit it at the end of the doubly-linked INSN list. diff --git a/gcc/gcse.c b/gcc/gcse.c index 9250f128d1f..1370be1c349 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -4108,7 +4108,7 @@ insert_insn_end_bb (struct expr *expr, basic_block bb, int pre) } #endif /* FIXME: What if something in cc0/jump uses value set in new insn? */ - new_insn = emit_insn_before (pat, insn); + new_insn = emit_insn_before_noloc (pat, insn); } /* Likewise if the last insn is a call, as will happen in the presence @@ -4146,10 +4146,10 @@ insert_insn_end_bb (struct expr *expr, basic_block bb, int pre) || NOTE_INSN_BASIC_BLOCK_P (insn)) insn = NEXT_INSN (insn); - new_insn = emit_insn_before (pat, insn); + new_insn = emit_insn_before_noloc (pat, insn); } else - new_insn = emit_insn_after (pat, insn); + new_insn = emit_insn_after_noloc (pat, insn); while (1) { @@ -6190,7 +6190,7 @@ insert_insn_start_bb (rtx insn, basic_block bb) before = NEXT_INSN (before); } - insn = emit_insn_after (insn, prev); + insn = emit_insn_after_noloc (insn, prev); if (gcse_file) { diff --git a/gcc/reload1.c b/gcc/reload1.c index 3a8c19e9711..7fc23bc9a71 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -7008,25 +7008,25 @@ emit_reload_insns (struct insn_chain *chain) reloads for the operand. The RELOAD_OTHER output reloads are output in descending order by reload number. */ - emit_insn_before_sameloc (other_input_address_reload_insns, insn); - emit_insn_before_sameloc (other_input_reload_insns, insn); + emit_insn_before (other_input_address_reload_insns, insn); + emit_insn_before (other_input_reload_insns, insn); for (j = 0; j < reload_n_operands; j++) { - emit_insn_before_sameloc (inpaddr_address_reload_insns[j], insn); - emit_insn_before_sameloc (input_address_reload_insns[j], insn); - emit_insn_before_sameloc (input_reload_insns[j], insn); + emit_insn_before (inpaddr_address_reload_insns[j], insn); + emit_insn_before (input_address_reload_insns[j], insn); + emit_insn_before (input_reload_insns[j], insn); } - emit_insn_before_sameloc (other_operand_reload_insns, insn); - emit_insn_before_sameloc (operand_reload_insns, insn); + emit_insn_before (other_operand_reload_insns, insn); + emit_insn_before (operand_reload_insns, insn); for (j = 0; j < reload_n_operands; j++) { - rtx x = emit_insn_after_sameloc (outaddr_address_reload_insns[j], insn); - x = emit_insn_after_sameloc (output_address_reload_insns[j], x); - x = emit_insn_after_sameloc (output_reload_insns[j], x); - emit_insn_after_sameloc (other_output_reload_insns[j], x); + rtx x = emit_insn_after (outaddr_address_reload_insns[j], insn); + x = emit_insn_after (output_address_reload_insns[j], x); + x = emit_insn_after (output_reload_insns[j], x); + emit_insn_after (other_output_reload_insns[j], x); } /* For all the spill regs newly reloaded in this instruction, diff --git a/gcc/rtl.h b/gcc/rtl.h index 8f7274a3c1b..ffc7ef5cb11 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -1455,19 +1455,25 @@ extern rtx assign_temp (tree, int, int, int); /* In emit-rtl.c */ extern rtx emit_insn_before (rtx, rtx); +extern rtx emit_insn_before_noloc (rtx, rtx); extern rtx emit_insn_before_setloc (rtx, rtx, int); extern rtx emit_jump_insn_before (rtx, rtx); +extern rtx emit_jump_insn_before_noloc (rtx, rtx); extern rtx emit_jump_insn_before_setloc (rtx, rtx, int); extern rtx emit_call_insn_before (rtx, rtx); +extern rtx emit_call_insn_before_noloc (rtx, rtx); extern rtx emit_call_insn_before_setloc (rtx, rtx, int); extern rtx emit_barrier_before (rtx); extern rtx emit_label_before (rtx, rtx); extern rtx emit_note_before (int, rtx); extern rtx emit_insn_after (rtx, rtx); +extern rtx emit_insn_after_noloc (rtx, rtx); extern rtx emit_insn_after_setloc (rtx, rtx, int); extern rtx emit_jump_insn_after (rtx, rtx); +extern rtx emit_jump_insn_after_noloc (rtx, rtx); extern rtx emit_jump_insn_after_setloc (rtx, rtx, int); extern rtx emit_call_insn_after (rtx, rtx); +extern rtx emit_call_insn_after_noloc (rtx, rtx); extern rtx emit_call_insn_after_setloc (rtx, rtx, int); extern rtx emit_barrier_after (rtx); extern rtx emit_label_after (rtx, rtx); @@ -1499,19 +1505,6 @@ extern rtx skip_consecutive_labels (rtx); extern rtx next_cc0_user (rtx); extern rtx prev_cc0_setter (rtx); -#define emit_insn_before_sameloc(INSN, BEFORE) \ - emit_insn_before_setloc (INSN, BEFORE, INSN_LOCATOR (BEFORE)) -#define emit_jump_insn_before_sameloc(INSN, BEFORE) \ - emit_jump_insn_before_setloc (INSN, BEFORE, INSN_LOCATOR (BEFORE)) -#define emit_call_insn_before_sameloc(INSN, BEFORE) \ - emit_call_insn_before_setloc (INSN, BEFORE, INSN_LOCATOR (BEFORE)) -#define emit_insn_after_sameloc(INSN, AFTER) \ - emit_insn_after_setloc (INSN, AFTER, INSN_LOCATOR (AFTER)) -#define emit_jump_insn_after_sameloc(INSN, AFTER) \ - emit_jump_insn_after_setloc (INSN, AFTER, INSN_LOCATOR (AFTER)) -#define emit_call_insn_after_sameloc(INSN, AFTER) \ - emit_call_insn_after_setloc (INSN, AFTER, INSN_LOCATOR (AFTER)) - /* In cfglayout.c */ extern tree choose_inner_scope (tree, tree); extern int insn_line (rtx); diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 3d505b5579b..83f039a5aae 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -1855,6 +1855,7 @@ eliminate (void) if (TREE_CODE (stmt) == MODIFY_EXPR && TREE_CODE (TREE_OPERAND (stmt, 0)) == SSA_NAME && TREE_CODE (TREE_OPERAND (stmt ,1)) != SSA_NAME + && TREE_CODE (TREE_OPERAND (stmt, 1)) != NOP_EXPR && !is_gimple_min_invariant (TREE_OPERAND (stmt, 1)) && !stmt_ann (stmt)->has_volatile_ops) { |