diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-12-06 14:37:59 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-12-06 14:37:59 +0000 |
commit | a0db5e0bd8f1348278937fe0ec60dec4db27a952 (patch) | |
tree | 7c4609ceb83330f3733601ee8198a7c1d7ef002e /gcc | |
parent | 0e7db5934151b5ce3fd812475531015e6e5a8a05 (diff) | |
download | gcc-a0db5e0bd8f1348278937fe0ec60dec4db27a952.tar.gz |
PR middle-end/43631
* var-tracking.c (emit_note_insn_var_location, emit_notes_in_bb):
Clear BLOCK_FOR_INSN on notes emitted in between basic blocks,
don't adjust BB_END when inserting note after BB_END of some bb.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194252 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/var-tracking.c | 33 |
2 files changed, 37 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 348a6f6a0bb..30bb3f96ae1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2012-12-06 Jakub Jelinek <jakub@redhat.com> + PR middle-end/43631 + * var-tracking.c (emit_note_insn_var_location, emit_notes_in_bb): + Clear BLOCK_FOR_INSN on notes emitted in between basic blocks, + don't adjust BB_END when inserting note after BB_END of some bb. + PR c++/55137 * fold-const.c (fold_binary_loc) <associate>: Don't introduce TREE_OVERFLOW through reassociation. If type doesn't have defined diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index f5ba115bcfe..c35471c4a34 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -8557,9 +8557,30 @@ emit_note_insn_var_location (void **varp, void *data) || NOTE_KIND (insn) == NOTE_INSN_CALL_ARG_LOCATION)) note = emit_note_after (NOTE_INSN_VAR_LOCATION, insn); else - note = emit_note_before (NOTE_INSN_VAR_LOCATION, insn); + { + note = emit_note_before (NOTE_INSN_VAR_LOCATION, insn); + /* If insn is BB_HEAD of some bb, make sure the note + doesn't have BLOCK_FOR_INSN set. The notes don't + extend the extents of a basic block, and e.g. notes emitted + for differences in between basic blocks should live in between + the basic blocks. */ + if (BLOCK_FOR_INSN (note) + && BB_HEAD (BLOCK_FOR_INSN (note)) == insn) + set_block_for_insn (note, NULL); + } } NOTE_VAR_LOCATION (note) = note_vl; + /* If insn is BB_END of some bb, make sure the note + doesn't have BLOCK_FOR_INSN set. The notes don't + extend the extents of a basic block, and e.g. a noreturn + call can still be followed by NOTE_INSN_CALL_ARG_LOCATION. */ + if (BLOCK_FOR_INSN (note) + && BB_END (BLOCK_FOR_INSN (note)) == note + && PREV_INSN (note) == insn) + { + BB_END (BLOCK_FOR_INSN (note)) = insn; + set_block_for_insn (note, NULL); + } set_dv_changed (var->dv, false); gcc_assert (var->in_changed_variables); @@ -8928,6 +8949,16 @@ emit_notes_in_bb (basic_block bb, dataflow_set *set) } note = emit_note_after (NOTE_INSN_CALL_ARG_LOCATION, insn); NOTE_VAR_LOCATION (note) = arguments; + /* If insn is BB_END of some bb, make sure the note + doesn't have BLOCK_FOR_INSN set. The notes don't + extend the extents of a basic block, and e.g. a noreturn + call can still be followed by NOTE_INSN_CALL_ARG_LOCATION. */ + if (BLOCK_FOR_INSN (note) + && BB_END (BLOCK_FOR_INSN (note)) == note) + { + BB_END (BLOCK_FOR_INSN (note)) = insn; + set_block_for_insn (note, NULL); + } } break; |