]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: rs6000.c (fusion_gpr_load_p): Refuse optimization if it would clobber the...
authorUlrich Weigand <uweigand@de.ibm.com>
Fri, 4 Apr 2014 17:00:50 +0000 (17:00 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Fri, 4 Apr 2014 17:00:50 +0000 (17:00 +0000)
Backport from mainline r208895:
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.

From-SVN: r209122

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

index 02f376ca406a98bdb03a706b9fbc23251a2d6385..efcfbf8c1421de7268d979d422b73d4bf57f0e2c 100644 (file)
@@ -1,3 +1,11 @@
+2014-04-04  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
+
+       Backport from mainline r208895:
+       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-04-04  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        Back port from main line:
index 28e370ed28f2df2737679206aa5ddf86a5ae6c81..4d7de4009cf25e8bc6a591b3d29ecf79423a299b 100644 (file)
@@ -32615,6 +32615,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);