aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2017-12-21 18:14:21 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2017-12-21 18:14:21 +0000
commit056cf43428e87bff0703ab4a6ec3558a90328be4 (patch)
tree60034773156af884394ff38decf779dd751a8978 /gcc
parentcb6332333854a698cbfc2ea4b1e52ce9bd59f664 (diff)
downloadgcc-056cf43428e87bff0703ab4a6ec3558a90328be4.zip
gcc-056cf43428e87bff0703ab4a6ec3558a90328be4.tar.gz
gcc-056cf43428e87bff0703ab4a6ec3558a90328be4.tar.bz2
[-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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/reorg.c9
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2851eb6..7200561 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
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.
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 96778ad..02d8adc 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -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)