rs6000.c (fusion_gpr_load_p): Refuse optimization if it would clobber the stack point...
authorUlrich Weigand <uweigand@de.ibm.com>
Fri, 28 Mar 2014 12:42:40 +0000 (12:42 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Fri, 28 Mar 2014 12:42:40 +0000 (12:42 +0000)
* config/rs6000/rs6000.c (fusion_gpr_load_p): Refuse optimization
if it would clobber the stack pointer, even temporarily.

From-SVN: r208895

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index faca258..82f387c 100644 (file)
@@ -1,3 +1,8 @@
+2014-03-28  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
+
+       * config/rs6000/rs6000.c (fusion_gpr_load_p): Refuse optimization
+       if it would clobber the stack pointer, even temporarily.
+
 2014-03-28  Eric Botcazou  <ebotcazou@adacore.com>
 
        * mode-switching.c: Make small adjustments to the top comment.
index cd85257..d9606a1 100644 (file)
@@ -32523,6 +32523,11 @@ fusion_gpr_load_p (rtx *operands, bool peep2_p)
 
       if (!peep2_reg_dead_p (2, addis_reg))
        return false;
+
+      /* If the target register being loaded is the stack pointer, we must
+         avoid loading any other value into it, even temporarily.  */
+      if (REG_P (target) && REGNO (target) == STACK_POINTER_REGNUM)
+       return false;
     }
 
   base_reg = XEXP (addr, 0);