From: wehle Date: Sat, 15 Jan 2000 20:46:21 +0000 (+0000) Subject: * gcse.c (insert_insn_end_bb): Use emit_block_insn_before X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=8b3dea0b9a901f551cd512b0189ec2eef80e0306 * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31437 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5bce0b790d8..3041ab04f49 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +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 * loop.c (this_loop_info): Delete. diff --git a/gcc/gcse.c b/gcc/gcse.c index a421d5442e2..a61463d5929 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -4416,9 +4416,7 @@ insert_insn_end_bb (expr, bb, pre) } #endif /* FIXME: What if something in cc0/jump uses value set in new insn? */ - new_insn = emit_insn_before (pat, insn); - if (BLOCK_HEAD (bb) == insn) - BLOCK_HEAD (bb) = new_insn; + new_insn = emit_block_insn_before (pat, insn, BASIC_BLOCK (bb)); } /* Likewise if the last insn is a call, as will happen in the presence of exception handling. */ @@ -4478,19 +4476,13 @@ insert_insn_end_bb (expr, bb, pre) 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 the insn in the wrong basic block. In that case, put the insn - after the CODE_LABEL. - - ?!? Do we need to account for NOTE_INSN_BASIC_BLOCK here? */ - if (GET_CODE (insn) != CODE_LABEL) - { - new_insn = emit_insn_before (pat, insn); - if (BLOCK_HEAD (bb) == insn) - BLOCK_HEAD (bb) = new_insn; - } - else - { - new_insn = emit_insn_after (pat, insn); - } + after the CODE_LABEL. Also, respect NOTE_INSN_BASIC_BLOCK. */ + if (GET_CODE (insn) == CODE_LABEL) + insn = NEXT_INSN (insn); + if (GET_CODE (insn) == NOTE + && NOTE_LINE_NUMBER (insn) == NOTE_INSN_BASIC_BLOCK) + insn = NEXT_INSN (insn); + new_insn = emit_block_insn_before (pat, insn, BASIC_BLOCK (bb)); } else {