diff mbox

[i386] : standard_80387_constant_p can return negative values

Message ID BANLkTik3Je7YZ_QCejcw2HGzUWEfeuF14w@mail.gmail.com
State New
Headers show

Commit Message

Uros Bizjak May 15, 2011, 7:34 p.m. UTC
Hello!

2011-05-15  Uros Bizjak  <ubizjak@gmail.com>

	* config/i386/i386.md (floating point move splitters): Fix
	usage of standard_80387_constant_p.
	* config/i386/i386.c (ix86_preferred_reload_class): Ditto.

Tested on x86_64-pc-linux-gnu {,-m32}, committed to mainline SVN.

Uros.
diff mbox

Patch

Index: i386.md
===================================================================
--- i386.md	(revision 173773)
+++ i386.md	(working copy)
@@ -3315,7 +3315,7 @@ 
     }
   else if (FP_REG_P (r))
     {
-      if (!standard_80387_constant_p (c))
+      if (standard_80387_constant_p (c) < 1)
 	FAIL;
     }
   else if (MMX_REG_P (r))
@@ -3347,7 +3347,7 @@ 
     }
   else if (FP_REG_P (r))
     {
-      if (!standard_80387_constant_p (c))
+      if (standard_80387_constant_p (c) < 1)
 	FAIL;
     }
   else if (MMX_REG_P (r))
Index: i386.c
===================================================================
--- i386.c	(revision 173771)
+++ i386.c	(working copy)
@@ -28489,7 +28489,7 @@  ix86_preferred_reload_class (rtx x, reg_
 	 zero above.  We only want to wind up preferring 80387 registers if
 	 we plan on doing computation with them.  */
       if (TARGET_80387
-	  && standard_80387_constant_p (x))
+	  && standard_80387_constant_p (x) > 0)
 	{
 	  /* Limit class to non-sse.  */
 	  if (regclass == FLOAT_SSE_REGS)