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
+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:
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);