aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2014-03-28 12:42:40 +0000
committerUlrich Weigand <uweigand@gcc.gnu.org>2014-03-28 12:42:40 +0000
commitbd302a183af5190fb504174099a9085c3859bc93 (patch)
treee4709c0ed404f735efc54de5f4354533f2ad7cf9
parentefeaaaafad228f4d451b399b93880a2b037561a0 (diff)
downloadgcc-bd302a183af5190fb504174099a9085c3859bc93.zip
gcc-bd302a183af5190fb504174099a9085c3859bc93.tar.gz
gcc-bd302a183af5190fb504174099a9085c3859bc93.tar.bz2
rs6000.c (fusion_gpr_load_p): Refuse optimization if it would clobber the stack pointer, even temporarily.
* config/rs6000/rs6000.c (fusion_gpr_load_p): Refuse optimization if it would clobber the stack pointer, even temporarily. From-SVN: r208895
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/rs6000/rs6000.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index faca258..82f387c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index cd85257..d9606a1 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -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);