diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-06-03 00:19:42 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-06-03 00:19:42 +0000 |
commit | 9fc37e9d209e58c3cf73804232c190160e69d00d (patch) | |
tree | b23daa7619a2d8de0701952f2424c2c285af000a /gcc/gcse.c | |
parent | 21c34afb30dd6c414adbd880e5c13136449ea27b (diff) | |
download | gcc-9fc37e9d209e58c3cf73804232c190160e69d00d.tar.gz |
�
* gcse.c (insert_insn_end_bb): Correct placement of insns when the
current block starts with a CODE_LABEL and ends with a CALL and
we can not find all the argument setup instructions for the CALL.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27321 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r-- | gcc/gcse.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c index d7fde36ecd8..deebc73e0a1 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -4189,9 +4189,26 @@ insert_insn_end_bb (expr, bb, pre) } } - new_insn = emit_insn_before (pat, insn); - if (BLOCK_HEAD (bb) == insn) - BLOCK_HEAD (bb) = new_insn; + /* If we found all the parameter loads, then we want to insert + before the first parameter load. + + If we did not find all the parameter loads, then we might have + 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); + } } else { |