gcse.c (eliminate_partially_redundant_loads): Reject change if dest is set between...
authorMostafa Hagog <mustafa@il.ibm.com>
Thu, 18 Mar 2004 20:09:04 +0000 (20:09 +0000)
committerDavid Edelsohn <dje@gcc.gnu.org>
Thu, 18 Mar 2004 20:09:04 +0000 (15:09 -0500)
2004-03-18  Mostafa Hagog  <mustafa@il.ibm.com>

        * gcse.c (eliminate_partially_redundant_loads): Reject change if
        dest is set between beginning and current insn.

From-SVN: r79636

gcc/ChangeLog
gcc/gcse.c

index fe19b78..765eca8 100644 (file)
@@ -1,3 +1,8 @@
+2004-03-18  Mostafa Hagog  <mustafa@il.ibm.com>
+
+       * gcse.c (eliminate_partially_redundant_loads): Reject change if
+       dest is set between beginning and current insn.
+
 2004-03-18  Mark Mitchell  <mark@codesourcery.com>
 
        * c-decl.c (grokdeclarator): Do not complain about redeclaring
index ce4d201..d75d459 100644 (file)
@@ -8319,10 +8319,12 @@ eliminate_partially_redundant_loads (basic_block bb, rtx insn,
 
   pat = PATTERN (insn);
   dest = SET_DEST (pat);
-  /* Check if the loaded register is not used nor killed from the beginning
-     of the block.  */
+  /* Check that the loaded register is not used, set, or killed from the
+     beginning of the block.  */
   if (reg_used_between_after_reload_p (dest,
-                                      PREV_INSN (BB_HEAD (bb)), insn))
+                                       PREV_INSN (BB_HEAD (bb)), insn)
+      || reg_set_between_after_reload_p (dest,
+                                         PREV_INSN (BB_HEAD (bb)), insn))
     return;
 
   /* Check potential for replacing load with copy for predecessors.  */