diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2019-07-09 09:58:51 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2019-07-09 09:58:51 +0000 |
commit | 495079550e135c7ad0605e9c549202c35625cde7 (patch) | |
tree | a352b4f90e8801018783b8d4abdd4009cc70b7f1 | |
parent | 4c12dc0556605578f4f35c4be27cff9fef28877b (diff) | |
download | gcc-495079550e135c7ad0605e9c549202c35625cde7.zip gcc-495079550e135c7ad0605e9c549202c35625cde7.tar.gz gcc-495079550e135c7ad0605e9c549202c35625cde7.tar.bz2 |
* ira-emit.c (emit_moves): Skip DEBUG_INSNs when setting the location.
From-SVN: r273297
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/ira-emit.c | 19 |
2 files changed, 15 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 21d7c1c..5a6a7f4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2019-07-09 Eric Botcazou <ebotcazou@adacore.com> + + * ira-emit.c (emit_moves): Skip DEBUG_INSNs when setting the location. + 2019-07-09 Sylvia Taylor <sylvia.taylor@arm.com> * config/arm/crypto.md: diff --git a/gcc/ira-emit.c b/gcc/ira-emit.c index c42acad..255af30 100644 --- a/gcc/ira-emit.c +++ b/gcc/ira-emit.c @@ -997,27 +997,30 @@ emit_moves (void) basic_block bb; edge_iterator ei; edge e; - rtx_insn *insns, *tmp; + rtx_insn *insns, *tmp, *next; FOR_EACH_BB_FN (bb, cfun) { if (at_bb_start[bb->index] != NULL) { at_bb_start[bb->index] = modify_move_list (at_bb_start[bb->index]); - insns = emit_move_list (at_bb_start[bb->index], - REG_FREQ_FROM_BB (bb)); + insns + = emit_move_list (at_bb_start[bb->index], REG_FREQ_FROM_BB (bb)); tmp = BB_HEAD (bb); if (LABEL_P (tmp)) tmp = NEXT_INSN (tmp); if (NOTE_INSN_BASIC_BLOCK_P (tmp)) tmp = NEXT_INSN (tmp); - /* Propagate the location of the current first instruction to the - moves so that they don't inherit a random location. */ - if (tmp != NULL_RTX && INSN_P (tmp)) - set_insn_locations (insns, INSN_LOCATION (tmp)); + /* Make sure to put the location of TMP or a subsequent instruction + to avoid inheriting the location of the previous instruction. */ + next = tmp; + while (next && !NONDEBUG_INSN_P (next)) + next = NEXT_INSN (next); + if (next) + set_insn_locations (insns, INSN_LOCATION (next)); if (tmp == BB_HEAD (bb)) emit_insn_before (insns, tmp); - else if (tmp != NULL_RTX) + else if (tmp) emit_insn_after (insns, PREV_INSN (tmp)); else emit_insn_after (insns, get_last_insn ()); |