diff mbox

PATCH: PR target/45213: "suffix or operands invalid for `push'" triggered by optimisations on x86_64

Message ID 20100806223827.GA1400@intel.com
State New
Headers show

Commit Message

H.J. Lu Aug. 6, 2010, 10:38 p.m. UTC
Hi,

"pushq $imm32S" only takes 32bit signed extended immediate. You can't push
0xbf800000. Instead, you push -1082130432 or 0xffffffffbf800000.  This
patch makes it signed.  OK for trunk/4.5/4.4?

Thanks.


H.J.
---
gcc/

2010-08-08  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/45213
	* config/i386/i386.c (ix86_print_operand): Use int instead of
	long with REAL_VALUE_TO_TARGET_SINGLE.

gcc/testsuite/

2010-08-08  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/45213
	* gcc.target/i386/pr45213.c.

Comments

Richard Henderson Aug. 10, 2010, 3:39 p.m. UTC | #1
On 08/06/2010 03:38 PM, H.J. Lu wrote:
> 	PR target/45213
> 	* config/i386/i386.c (ix86_print_operand): Use int instead of
> 	long with REAL_VALUE_TO_TARGET_SINGLE.

Surely we can also simplify the bits following to

  fprintf (file, "%d", l);


r~
diff mbox

Patch

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 204211a..f461481 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -12914,7 +12914,7 @@  ix86_print_operand (FILE *file, rtx x, int code)
   else if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) == SFmode)
     {
       REAL_VALUE_TYPE r;
-      long l;
+      int l;
 
       REAL_VALUE_FROM_CONST_DOUBLE (r, x);
       REAL_VALUE_TO_TARGET_SINGLE (r, l);
--- /dev/null	2010-07-23 13:04:30.193381062 -0700
+++ gcc/gcc/testsuite/gcc.target/i386/pr45213.c	2010-08-06 15:15:03.680353825 -0700
@@ -0,0 +1,9 @@ 
+/* PR target/45213 */
+/* { dg-do assemble } */
+/* { dg-options "-Os -fno-omit-frame-pointer" } */
+
+void f(float, float, float, float, float, float, float, float, float, float);
+
+void g() {
+  f(0,0,0,0, 0,0,0,0, -1,1);
+}