[Bug target/12749] New: i386 LP64 bug.

matt at 3am-software dot com gcc-bugzilla@gcc.gnu.org
Thu Oct 23 20:42:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12749

           Summary: i386 LP64 bug.
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: matt at 3am-software dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: x86_64--netbsd
  GCC host triplet: x86_64--netbsd
GCC target triplet: i386--netbsdelf

The attached program will emit assembly that gas will complain about:
e_sinhf.s:134: Error: missing or invalid immediate expression 
`0xffffffffbf000000' taken as 0
e_sinhf.s:134: Error: suffix or operands invalid for `mov'

--- i386.c      18 Oct 2003 11:10:38 -0000      1.1.1.2
+++ i386.c      23 Oct 2003 20:39:10 -0000
@@ -7076,21 +7076,21 @@
   else if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) == SFmode)
     {
       REAL_VALUE_TYPE r;
       long l;
 
       REAL_VALUE_FROM_CONST_DOUBLE (r, x);
       REAL_VALUE_TO_TARGET_SINGLE (r, l);
 
       if (ASSEMBLER_DIALECT == ASM_ATT)
        putc ('$', file);
-      fprintf (file, "0x%lx", l);
+      fprintf (file, "0x%lx", l & 0xffffffff);
     }
 
  /* These float cases don't actually occur as immediate operands.  */
  else if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) == DFmode)
     {
       char dstr[30];
 
       real_to_decimal (dstr, CONST_DOUBLE_REAL_VALUE (x), sizeof (dstr), 0, 1);
       fprintf (file, "%s", dstr);
     }





float fabsf (float);
typedef int __int32_t;
typedef unsigned int __uint32_t;
typedef union
{
  float value;
  __uint32_t word;
} ieee_float_shape_type;
extern float __ieee754_expf (float);
extern float __ieee754_sinhf (float);
static const float one = 1.0, shuge = 1.0e37;
float
__ieee754_sinhf(float x)
{
        float t,w,h;
        __int32_t ix,jx;
        do { ieee_float_shape_type gf_u; gf_u.value = (x); (jx) = gf_u.word; } w
hile (0);
        ix = jx&0x7fffffff;
        if(ix>=0x7f800000) return x+x;
        h = 0.5;
        if (jx<0) h = -h;
        if (ix < 0x41b00000) {
            if (ix<0x31800000)
                if(shuge+x>one) return x;
            t = expm1f(fabsf(x));
            if(ix<0x3f800000) return h*((float)2.0*t-t*t/(t+one));
            return h*(t+t/(t+one));
        }
        if (ix < 0x42b17180) return h*__ieee754_expf(fabsf(x));
        if (ix<=0x42b2d4fc) {
            w = __ieee754_expf((float)0.5*fabsf(x));
            t = h*w;
            return t*w;
        }
        return x*shuge;
}



More information about the Gcc-bugs mailing list