Commit b5229628 by John Wehle Committed by John Wehle

gcse.c (insert_insn_end_bb): Use emit_block_insn_before instead of emit_insn_before.

	* gcse.c (insert_insn_end_bb): Use emit_block_insn_before
	instead of emit_insn_before.  Also handle NOTE_INSN_BASIC_BLOCK
	when walking backwards to find all the parameter loads when
	the basic block ends in a call.

From-SVN: r31437
parent 8430ac57
Sat Jan 15 15:41:14 EST 2000 John Wehle (john@feith.com)
* gcse.c (insert_insn_end_bb): Use emit_block_insn_before
instead of emit_insn_before. Also handle NOTE_INSN_BASIC_BLOCK
when walking backwards to find all the parameter loads when
the basic block ends in a call.
2000-01-15 Michael Hayes <m.hayes@elec.canterbury.ac.nz> 2000-01-15 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (this_loop_info): Delete. * loop.c (this_loop_info): Delete.
......
...@@ -4416,9 +4416,7 @@ insert_insn_end_bb (expr, bb, pre) ...@@ -4416,9 +4416,7 @@ insert_insn_end_bb (expr, bb, pre)
} }
#endif #endif
/* FIXME: What if something in cc0/jump uses value set in new insn? */ /* FIXME: What if something in cc0/jump uses value set in new insn? */
new_insn = emit_insn_before (pat, insn); new_insn = emit_block_insn_before (pat, insn, BASIC_BLOCK (bb));
if (BLOCK_HEAD (bb) == insn)
BLOCK_HEAD (bb) = new_insn;
} }
/* Likewise if the last insn is a call, as will happen in the presence /* Likewise if the last insn is a call, as will happen in the presence
of exception handling. */ of exception handling. */
...@@ -4478,19 +4476,13 @@ insert_insn_end_bb (expr, bb, pre) ...@@ -4478,19 +4476,13 @@ insert_insn_end_bb (expr, bb, pre)
stopped on the head of the block, which could be a CODE_LABEL. stopped on the head of the block, which could be a CODE_LABEL.
If we inserted before the CODE_LABEL, then we would be putting If we inserted before the CODE_LABEL, then we would be putting
the insn in the wrong basic block. In that case, put the insn the insn in the wrong basic block. In that case, put the insn
after the CODE_LABEL. after the CODE_LABEL. Also, respect NOTE_INSN_BASIC_BLOCK. */
if (GET_CODE (insn) == CODE_LABEL)
?!? Do we need to account for NOTE_INSN_BASIC_BLOCK here? */ insn = NEXT_INSN (insn);
if (GET_CODE (insn) != CODE_LABEL) if (GET_CODE (insn) == NOTE
{ && NOTE_LINE_NUMBER (insn) == NOTE_INSN_BASIC_BLOCK)
new_insn = emit_insn_before (pat, insn); insn = NEXT_INSN (insn);
if (BLOCK_HEAD (bb) == insn) new_insn = emit_block_insn_before (pat, insn, BASIC_BLOCK (bb));
BLOCK_HEAD (bb) = new_insn;
}
else
{
new_insn = emit_insn_after (pat, insn);
}
} }
else else
{ {
......
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