Commit 96fba521 by Steven Bosscher

re PR middle-end/43631 (var-tracking inserts notes with non-NULL BLOCK_FOR_INSN…

re PR middle-end/43631 (var-tracking inserts notes with non-NULL BLOCK_FOR_INSN in between basic blocks)


	PR middle-end/43631
	* emit-rtl.c (make_note_raw): New function.
	(link_insn_into_chain): New static inline function.
	(add_insn): Use it.
	(add_insn_before, add_insn_after): Factor insn chain linking code...
	(add_insn_before_nobb, add_insn_after_nobb): ...here, new functions
	using link_insn_into_chain.
	(note_outside_basic_block_p): New helper function for emit_note_after
	and emit_note_before.
	(emit_note_after): Use nobb variant of add_insn_after if the note
	should not be contained in a basic block.
	(emit_note_before): Use nobb variant of add_insn_before if the note
	should not be contained in a basic block.
	(emit_note_copy): Use make_note_raw.
	(emit_note): Likewise.
	* bb-reorder.c (insert_section_boundary_note): Remove hack to set
	BLOCK_FOR_INSN to NULL manually for NOTE_INSN_SWITCH_TEXT_SECTIONS.
	* jump.c (cleanup_barriers): Use reorder_insns_nobb to avoid making
	the moved barrier the tail of the basic block it follows.
	* var-tracking.c (pass_variable_tracking): Add TODO_verify_flow.

From-SVN: r197994
parent 996943be
2013-04-16 Steven Bosscher <steven@gcc.gnu.org>
PR middle-end/43631
* emit-rtl.c (make_note_raw): New function.
(link_insn_into_chain): New static inline function.
(add_insn): Use it.
(add_insn_before, add_insn_after): Factor insn chain linking code...
(add_insn_before_nobb, add_insn_after_nobb): ...here, new functions
using link_insn_into_chain.
(note_outside_basic_block_p): New helper function for emit_note_after
and emit_note_before.
(emit_note_after): Use nobb variant of add_insn_after if the note
should not be contained in a basic block.
(emit_note_before): Use nobb variant of add_insn_before if the note
should not be contained in a basic block.
(emit_note_copy): Use make_note_raw.
(emit_note): Likewise.
* bb-reorder.c (insert_section_boundary_note): Remove hack to set
BLOCK_FOR_INSN to NULL manually for NOTE_INSN_SWITCH_TEXT_SECTIONS.
* jump.c (cleanup_barriers): Use reorder_insns_nobb to avoid making
the moved barrier the tail of the basic block it follows.
* var-tracking.c (pass_variable_tracking): Add TODO_verify_flow.
2013-04-15 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/56962
......
......@@ -2173,7 +2173,6 @@ static void
insert_section_boundary_note (void)
{
basic_block bb;
rtx new_note;
int first_partition = 0;
if (!flag_reorder_blocks_and_partition)
......@@ -2185,11 +2184,7 @@ insert_section_boundary_note (void)
first_partition = BB_PARTITION (bb);
if (BB_PARTITION (bb) != first_partition)
{
new_note = emit_note_before (NOTE_INSN_SWITCH_TEXT_SECTIONS,
BB_HEAD (bb));
/* ??? This kind of note always lives between basic blocks,
but add_insn_before will set BLOCK_FOR_INSN anyway. */
BLOCK_FOR_INSN (new_note) = NULL;
emit_note_before (NOTE_INSN_SWITCH_TEXT_SECTIONS, BB_HEAD (bb));
break;
}
}
......
......@@ -133,7 +133,7 @@ cleanup_barriers (void)
if (BARRIER_P (prev))
delete_insn (insn);
else if (prev != PREV_INSN (insn))
reorder_insns (insn, insn, prev);
reorder_insns_nobb (insn, insn, prev);
}
}
return 0;
......
......@@ -10238,6 +10238,7 @@ struct rtl_opt_pass pass_variable_tracking =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_verify_rtl_sharing /* todo_flags_finish */
TODO_verify_rtl_sharing
| TODO_verify_flow /* todo_flags_finish */
}
};
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