[RS6000] powerpc64le -ffixed-cr2 -ffixed-cr3 -ffixed-cr4 ICE
authorAlan Modra <amodra@gmail.com>
Tue, 3 May 2016 23:51:34 +0000 (09:21 +0930)
committerAlan Modra <amodra@gcc.gnu.org>
Tue, 3 May 2016 23:51:34 +0000 (09:21 +0930)
gcc/
PR target/70866
* config/rs6000/rs6000.c (rs6000_stack_info): Don't set cr_save_p
when cr2,3,4 are all fixed regs.
gcc/testsuite/
* gcc.target/powerpc/pr70866.c: New.

From-SVN: r235851

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/pr70866.c [new file with mode: 0644]

index d9ae26a8093714889ec5879f8f2bab4838ab1fc1..79fb0f48598d709afdf96ae228c52c8f64c5ae14 100644 (file)
@@ -1,3 +1,9 @@
+2016-05-04  Alan Modra  <amodra@gmail.com>
+
+       PR target/70866
+       * config/rs6000/rs6000.c (rs6000_stack_info): Don't set cr_save_p
+       when cr2,3,4 are all fixed regs.
+
 2016-05-04  Bernd Schmidt  <bschmidt@redhat.com>
 
        PR rtl-optimization/57193
index 61d39242b39a3308771d89284c58986408486390..a88cb190683524a75f22f20ca1a558cf79c652c9 100644 (file)
@@ -23689,9 +23689,9 @@ rs6000_stack_info (void)
   info->calls_p = (!crtl->is_leaf || cfun->machine->ra_needs_full_frame);
 
   /* Determine if we need to save the condition code registers.  */
-  if (df_regs_ever_live_p (CR2_REGNO)
-      || df_regs_ever_live_p (CR3_REGNO)
-      || df_regs_ever_live_p (CR4_REGNO))
+  if (save_reg_p (CR2_REGNO)
+      || save_reg_p (CR3_REGNO)
+      || save_reg_p (CR4_REGNO))
     {
       info->cr_save_p = 1;
       if (DEFAULT_ABI == ABI_V4)
index b83de7369fd58c53a4668f193e3df96eb45fe968..6c1397d78c0e63aea8afe9129817c31404ab7ba7 100644 (file)
@@ -1,3 +1,7 @@
+2016-05-04  Alan Modra  <amodra@gmail.com>
+
+       * gcc.target/powerpc/pr70866.c: New.
+
 2016-05-03  Martin Sebor  <msebor@redhat.com>
 
        PR c++/66561
diff --git a/gcc/testsuite/gcc.target/powerpc/pr70866.c b/gcc/testsuite/gcc.target/powerpc/pr70866.c
new file mode 100644 (file)
index 0000000..25fd05a
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-ffixed-cr2 -ffixed-cr3 -ffixed-cr4" } */
+
+#define SET_CR(R,V) __asm__ __volatile__ ("mtcrf %0,%1" : : "n" (1<<(7-R)), "r" (V<<(4*(7-R))) : "cr" #R)
+
+void foo (void)
+{
+  SET_CR (2, 7);
+  SET_CR (3, 8);
+  SET_CR (4, 9);
+}