cse.c (cse_insn): Don't cse past a basic block boundary.
authorAndrew Haley <aph@redhat.com>
Tue, 10 Dec 2002 16:35:37 +0000 (16:35 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Tue, 10 Dec 2002 16:35:37 +0000 (16:35 +0000)
2002-12-10  Andrew Haley  <aph@redhat.com>

* cse.c (cse_insn): Don't cse past a basic block boundary.

From-SVN: r60000

gcc/ChangeLog
gcc/cse.c

index 91f44af8ec1674e7ae26db41b8da037e460bdde6..d3ed606e61d2853919031438172b3802b3b87b96 100644 (file)
@@ -1,3 +1,7 @@
+2002-12-10  Andrew Haley  <aph@redhat.com>
+
+       * cse.c (cse_insn): Don't cse past a basic block boundary.
+
 2002-12-10  Jakub Jelinek  <jakub@redhat.com>
 
        * config/linux.h (LIB_SPEC): If -pthread, add -lpthread even if
index 9688204c466b18a016256f4c05543580469420ff..1d606b60c1302e6b52dd890d40ece90815b2cf74 100644 (file)
--- 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.