[RS6000] SDmode and reload

2014-02-05 Thread Alan Modra
This little patch fixes a number of dfp failures:

Fail: c-c++-common/dfp/func-vararg-alternate-d32.c execution test
FAIL: c-c++-common/dfp/func-vararg-alternate-d32.c -std=c++11 execution test
FAIL: c-c++-common/dfp/func-vararg-alternate-d32.c -std=c++98 execution test
FAIL: c-c++-common/dfp/func-vararg-dfp.c execution test
FAIL: c-c++-common/dfp/func-vararg-dfp.c -std=c++11 execution test
FAIL: c-c++-common/dfp/func-vararg-dfp.c -std=c++98 execution test
FAIL: c-c++-common/dfp/func-vararg-mixed.c execution test
FAIL: c-c++-common/dfp/func-vararg-mixed.c -std=c++11 execution test
FAIL: c-c++-common/dfp/func-vararg-mixed.c -std=c++98 execution test
FAIL: decimal/pr54036-1.cc (test for excess errors)
FAIL: gcc.dg/compat/scalar-by-value-dfp c_compat_x_tst.o-c_compat_y_tst.o 
execute 
FAIL: gcc.dg/compat/scalar-return-dfp c_compat_x_tst.o-c_compat_y_tst.o execute 
FAIL: gcc.target/powerpc/ppc32-abi-dfp-1.c execution test
FAIL: g++.dg/compat/decimal/pass-1 cp_compat_x_tst.o-cp_compat_y_tst.o execute 
FAIL: g++.dg/compat/decimal/pass-2 cp_compat_x_tst.o-cp_compat_y_tst.o execute 
FAIL: g++.dg/compat/decimal/pass-3 cp_compat_x_tst.o-cp_compat_y_tst.o execute 
FAIL: g++.dg/compat/decimal/pass-4 cp_compat_x_tst.o-cp_compat_y_tst.o execute 
FAIL: g++.dg/compat/decimal/pass-5 cp_compat_x_tst.o-cp_compat_y_tst.o execute 
FAIL: g++.dg/compat/decimal/pass-6 cp_compat_x_tst.o-cp_compat_y_tst.o execute 
FAIL: g++.dg/compat/decimal/return-1 cp_compat_x_tst.o-cp_compat_y_tst.o 
execute 
FAIL: g++.dg/compat/decimal/return-2 cp_compat_x_tst.o-cp_compat_y_tst.o 
execute 
FAIL: g++.dg/compat/decimal/return-3 cp_compat_x_tst.o-cp_compat_y_tst.o 
execute 
FAIL: g++.dg/compat/decimal/return-4 cp_compat_x_tst.o-cp_compat_y_tst.o 
execute 
FAIL: g++.dg/compat/decimal/return-5 cp_compat_x_tst.o-cp_compat_y_tst.o 
execute 
FAIL: g++.dg/compat/decimal/return-6 cp_compat_x_tst.o-cp_compat_y_tst.o 
execute 

Vlad added rs6000_secondary_memory_needed_mode for lra, and in so
doing broke reload's use of cfun-machine-sdmode_stack_slot in
rs6000_secondary_memory_needed_rtx (mode was no longer SDmode there).
Bootstrapped and regression tested powerpc64-linux, both with and
without -mlra.  OK to commit?

PR target/60032
* config/rs6000/rs6000.c (rs6000_secondary_memory_needed_mode): Only
change SDmode to DDmode when lra_in_progress.

* gcc.target/powerpc/pr60032.c: New.

Index: gcc/config/rs6000/rs6000.c
===
--- gcc/config/rs6000/rs6000.c  (revision 207417)
+++ gcc/config/rs6000/rs6000.c  (working copy)
@@ -15581,7 +15581,7 @@
 enum machine_mode
 rs6000_secondary_memory_needed_mode (enum machine_mode mode)
 {
-  if (mode == SDmode)
+  if (lra_in_progress  mode == SDmode)
 return DDmode;
   return mode;
 }
Index: gcc/testsuite/gcc.target/powerpc/pr60032.c
===
--- gcc/testsuite/gcc.target/powerpc/pr60032.c  (revision 0)
+++ gcc/testsuite/gcc.target/powerpc/pr60032.c  (revision 0)
@@ -0,0 +1,13 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-require-effective-target dfp } */
+/* { dg-options -O2 } */
+
+void foo (void)
+{
+  register float __attribute__ ((mode(SD))) r31 __asm__ (r31);
+  register float __attribute__ ((mode(SD))) fr1 __asm__ (fr1);
+
+  __asm__ (# : =d (fr1));
+  r31 = fr1;
+  __asm__ (# : : r (r31));
+}

-- 
Alan Modra
Australia Development Lab, IBM


Re: [RS6000] SDmode and reload

2014-02-05 Thread David Edelsohn
On Wed, Feb 5, 2014 at 8:27 AM, Alan Modra amo...@gmail.com wrote:

 Vlad added rs6000_secondary_memory_needed_mode for lra, and in so
 doing broke reload's use of cfun-machine-sdmode_stack_slot in
 rs6000_secondary_memory_needed_rtx (mode was no longer SDmode there).
 Bootstrapped and regression tested powerpc64-linux, both with and
 without -mlra.  OK to commit?

 PR target/60032
 * config/rs6000/rs6000.c (rs6000_secondary_memory_needed_mode): Only
 change SDmode to DDmode when lra_in_progress.

 * gcc.target/powerpc/pr60032.c: New.

So Vlad added the definition to the rs6000 port, but it only is needed
by LRA and does not interact correctly with classic reload.

Okay.

- David