summaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-10 16:35:37 +0000
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-10 16:35:37 +0000
commitbb9099b3d65759c9fb58560c28b4020e2df71595 (patch)
treed3256387303f49f996553760d5175845fdb61ac3 /gcc/cse.c
parentb0f5e946991bc8e94911026ba6cec84695ab6278 (diff)
downloadgcc-bb9099b3d65759c9fb58560c28b4020e2df71595.tar.gz
2002-12-10 Andrew Haley <aph@redhat.com>
* cse.c (cse_insn): Don't cse past a basic block boundary. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60000 138bc75d-0d04-0410-961f-82ee72b054a4
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 9688204c466..1d606b60c13 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.