Commit a7102479 by Jan Hubicka Committed by Jan Hubicka

re PR debug/13974 (bad line marker in debug info)

	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.

From-SVN: r88358
parent 91086990
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.
......
......@@ -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);
......
......@@ -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.
......
......@@ -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)
{
......
......@@ -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,
......
......@@ -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);
......
......@@ -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)
{
......
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