Commit 056cf434 by Alexandre Oliva Committed by Alexandre Oliva

[-fcompare-debug] retain insn locations when turning dbr seq into return

A number of -fcompare-debug errors on sparc arise as we split a dbr
SEQUENCE back into separate insns to turn the branch into a return.
If we just take the location from the PREV_INSN, it might be a debug
insn without INSN_LOCATION, or an insn with an unrelated location.
But that's silly: each of the SEQUENCEd insns is still an insn with
its own INSN_LOCATION, so use that instead, even though some may have
been adjusted while constructing the SEQUENCE.

for  gcc/ChangeLog

	* reorg.c (make_return_insns): Reemit each insn with its own
	location.

From-SVN: r255948
parent cb633233
2017-12-21 Alexandre Oliva <aoliva@redhat.com>
* reorg.c (make_return_insns): Reemit each insn with its own
location.
2017-12-21 Alexandre Oliva <aoliva@redhat.com>
PR debug/83419
* c-family/c-semantics.c (pop_stmt_list): Propagate side
effects from single nondebug stmt to container list.
......@@ -3612,9 +3612,14 @@ make_return_insns (rtx_insn *first)
delete_related_insns (insn);
for (i = 1; i < XVECLEN (pat, 0); i++)
prev = emit_insn_after (PATTERN (XVECEXP (pat, 0, i)), prev);
{
rtx_insn *in_seq_insn = as_a<rtx_insn *> (XVECEXP (pat, 0, i));
prev = emit_insn_after_setloc (PATTERN (in_seq_insn), prev,
INSN_LOCATION (in_seq_insn));
}
insn = emit_jump_insn_after (PATTERN (jump_insn), prev);
insn = emit_jump_insn_after_setloc (PATTERN (jump_insn), prev,
INSN_LOCATION (jump_insn));
emit_barrier_after (insn);
if (slots)
......
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