This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RS6000] Fix ICE caused by rs6000_savres_strategy thinko
- From: Alan Modra <amodra at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: David Edelsohn <dje dot gcc at gmail dot com>, Segher Boessenkool <segher at kernel dot crashing dot org>
- Date: Tue, 3 May 2016 21:02:26 +0930
- Subject: [RS6000] Fix ICE caused by rs6000_savres_strategy thinko
- Authentication-results: sourceware.org; auth=none
rev 235672 (git cffc0b35) changed the condition for SAVE_MULTIPLE/
STORE_MULTIPLE, wrongly allowing a single reg. Bootstrapped and
regression tested powerpc64-linux. OK to apply?
Incidentally, the added testcase function shows a regression in -m32
-Os code quality that I'll fix sometime soon.
gcc/
* config/rs6000/rs6000.c (rs6000_savres_strategy): Correct condition
for SAVE_MULTIPLE/STORE_MULTIPLE.
gcc/testsuite/
* gcc.target/powerpc/savres.c: Add func using a single gpr.
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index e94aa66..6fa8a0c 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -23438,7 +23438,7 @@ rs6000_savres_strategy (rs6000_stack_t *info,
if (TARGET_MULTIPLE
&& !TARGET_POWERPC64
&& !(TARGET_SPE_ABI && info->spe_64bit_regs_used)
- && info->first_gp_reg_save != 32)
+ && info->first_gp_reg_save < 31)
{
/* Prefer store multiple for saves over out-of-line routines,
since the store-multiple instruction will always be smaller. */
diff --git a/gcc/testsuite/gcc.target/powerpc/savres.c b/gcc/testsuite/gcc.target/powerpc/savres.c
index 5ebadf6..9432ed7 100644
--- a/gcc/testsuite/gcc.target/powerpc/savres.c
+++ b/gcc/testsuite/gcc.target/powerpc/savres.c
@@ -447,6 +447,16 @@ void s_r (void)
__asm __volatile ("#%0" : "=m" (a) : : "r30", "r31");
}
+void s_r31 (void)
+{
+ char a[33];
+#ifndef NO_BODY
+ TRASH_GPR (r31);
+ __asm__ __volatile__ ("#%0" : : "r" (r31));
+#endif
+ __asm __volatile ("#%0" : "=m" (a) : : "r31");
+}
+
void s_c (void)
{
char a[33];
@@ -1154,6 +1164,8 @@ main (void)
VERIFY_REGS;
s_r ();
VERIFY_REGS;
+ s_r31 ();
+ VERIFY_REGS;
s_c ();
VERIFY_REGS;
s_0 ();
--
Alan Modra
Australia Development Lab, IBM