Fix easy_fp_constant for E500 double TFmode

Joseph S. Myers joseph@codesourcery.com
Sat Jun 28 16:19:00 GMT 2008


This patch makes config/rs6000/predicates.md:easy_fp_constant reject
TFmode constants for E500 double like it does with DFmode constants.
The ICE it fixes (at -O2 and some other levels on the testcase added)
arises when the "easy" constant only gets forced to memory as part of
an input reload, too late for the address itself then to be reloaded
into a form suitable for E500 DFmode loads (the constant gets split as
part of this process).

Tested with no regressions with cross to powerpc-none-linux-gnuspe.
OK to commit (trunk and 4.3 branch)?

2008-06-28  Joseph Myers  <joseph@codesourcery.com>

	* config/rs6000/predicates.md (easy_fp_constant): Reject TFmode
	constants for E500 double.

testsuite:
2008-06-28  Joseph Myers  <joseph@codesourcery.com>

	* gcc.c-torture/compile/20080628-1.c: New test.

Index: gcc/testsuite/gcc.c-torture/compile/20080628-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/20080628-1.c	(revision 0)
+++ gcc/testsuite/gcc.c-torture/compile/20080628-1.c	(revision 0)
@@ -0,0 +1,15 @@
+void f (long double, long double);
+
+struct s {
+  char c;
+  struct s *p;
+} *p;
+
+void
+g (void)
+{
+  long double ld;
+  p->p->c = 1;
+  ld = p->p->c;
+  f (ld, 1.0L);
+}
Index: gcc/config/rs6000/predicates.md
===================================================================
--- gcc/config/rs6000/predicates.md	(revision 137216)
+++ gcc/config/rs6000/predicates.md	(working copy)
@@ -213,6 +213,9 @@
   switch (mode)
     {
     case TFmode:
+      if (TARGET_E500_DOUBLE)
+	return 0;
+
       REAL_VALUE_FROM_CONST_DOUBLE (rv, op);
       REAL_VALUE_TO_TARGET_LONG_DOUBLE (rv, k);
 

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list