public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, rs6000] Fix PR target/67808, LRA ICE on double to long double conversion
@ 2015-10-02 19:04 Peter Bergner
  2015-10-02 20:25 ` David Edelsohn
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Peter Bergner @ 2015-10-02 19:04 UTC (permalink / raw)
  To: GCC Patches; +Cc: David Edelsohn, Michael Meissner, Segher Boessenkool

PR67808 exposes a problem with the constraints in the *extenddftf2_internal
pattern, in that it allows TFmode operands to occupy Altivec registers
which they are not allowed to do.  Reload was able to work around the
problem, but LRA is more pedantic and it caused it to go into an infinite
spill loop until it ICEd.  The following patch from Mike changes the TFmode
output operand to use the "d" constraint instead of "ws".  It also allows
using the "ws" constraint for the two input operands, since that is allowed
for DFmode operands.

This passed bootstraps (with reload on by default and lra on by default)
and shows no testsuite regressions.  Is this ok for trunk?

The bug is also present in the FSF 5 branch (4.9 is ok), is this ok for
that too, assuming my bootstrap/regtesting there are clean?

Peter


gcc/
	PR target/67808
	* config/rs6000/rs6000.md (*extenddftf2_internal): Fix constraints.

gcc/testsuite/

	* gcc.target/powerpc/pr67808.c: New test.

Index: gcc/config/rs6000/rs6000.md
===================================================================
--- gcc/config/rs6000/rs6000.md	(revision 228387)
+++ gcc/config/rs6000/rs6000.md	(working copy)
@@ -6511,9 +6511,9 @@
 })
 
 (define_insn_and_split "*extenddftf2_internal"
-  [(set (match_operand:TF 0 "nonimmediate_operand" "=m,Y,ws,d,&d")
-       (float_extend:TF (match_operand:DF 1 "input_operand" "d,r,md,md,md")))
-   (use (match_operand:DF 2 "zero_reg_mem_operand" "d,r,j,m,d"))]
+  [(set (match_operand:TF 0 "nonimmediate_operand" "=m,Y,d,d,&d")
+       (float_extend:TF (match_operand:DF 1 "input_operand" "ws,r,md,md,md")))
+   (use (match_operand:DF 2 "zero_reg_mem_operand" "ws,r,j,m,ws"))]
   "!TARGET_IEEEQUAD
    && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT 
    && TARGET_LONG_DOUBLE_128"
Index: gcc/testsuite/gcc.target/powerpc/pr67808.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/pr67808.c	(revision 0)
+++ gcc/testsuite/gcc.target/powerpc/pr67808.c	(working copy)
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-O1 -mvsx -mlra" } */
+
+/* PR 67808: LRA ICEs on simple double to long double conversion test case */
+
+void
+foo (long double *ldb1, double *db1)
+{
+  *ldb1 = *db1;
+}


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-11-21 18:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-02 19:04 [PATCH, rs6000] Fix PR target/67808, LRA ICE on double to long double conversion Peter Bergner
2015-10-02 20:25 ` David Edelsohn
2015-10-05 17:12 ` Michael Meissner
2015-10-05 17:39   ` Peter Bergner
2015-10-05 22:36     ` Michael Meissner
2015-10-06 14:33       ` David Edelsohn
2015-11-21  1:21 ` [PATCH, rs6000, gcc 5 backport] " Michael Meissner
2015-11-21 18:50   ` David Edelsohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).