aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2002-12-10 16:35:37 +0000
committerAndrew Haley <aph@gcc.gnu.org>2002-12-10 16:35:37 +0000
commit3e25353ee782062cd488c4dc0382096e2276c17a (patch)
treed3256387303f49f996553760d5175845fdb61ac3 /gcc/cse.c
parent4fe1edca4d160e9161fe232dbfe74dd65b80edfe (diff)
downloadgcc-3e25353ee782062cd488c4dc0382096e2276c17a.zip
gcc-3e25353ee782062cd488c4dc0382096e2276c17a.tar.gz
gcc-3e25353ee782062cd488c4dc0382096e2276c17a.tar.bz2
cse.c (cse_insn): Don't cse past a basic block boundary.
2002-12-10 Andrew Haley <aph@redhat.com> * cse.c (cse_insn): Don't cse past a basic block boundary. From-SVN: r60000
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 9688204..1d606b6 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -6316,8 +6316,16 @@ cse_insn (insn, libcall_insn)
if ((src_ent->first_reg == REGNO (SET_DEST (sets[0].rtl)))
&& ! find_reg_note (insn, REG_RETVAL, NULL_RTX))
{
- rtx prev = prev_nonnote_insn (insn);
-
+ rtx prev = insn;
+ /* Scan for the previous nonnote insn, but stop at a basic
+ block boundary. */
+ do
+ {
+ prev = PREV_INSN (prev);
+ }
+ while (prev && GET_CODE (prev) == NOTE
+ && NOTE_LINE_NUMBER (prev) != NOTE_INSN_BASIC_BLOCK);
+
/* Do not swap the registers around if the previous instruction
attaches a REG_EQUIV note to REG1.