[PATCH]: Promote float args on i386 (attn Hurd, Cygwin, DJGPP...)

Mark Kettenis kettenis@wins.uva.nl
Fri May 12 09:33:00 GMT 2000


   Date: Fri, 12 May 2000 08:07:08 -0700
   From: Michael Snyder <msnyder@cygnus.com>

   Eli Zaretskii wrote:
   > 
   > > From: Michael Snyder <msnyder@cygnus.com>
   > > Date: Thu, 11 May 2000 22:57:53 -0700 (PDT)
   > >
   > > From the evidence, it appears that i386-gcc passes floats on the
   > > stack after promoting them to doubles.  At least I've verified this
   > > on Linux, Solaris and Unixware.  This patch fixes five testsuite
   > > failures by making GDB pass floats as doubles when it calls a
   > > target function.  I'd appreciate verification / approval from the
   > > maintainers of other x86 platforms such as Hurd, DJGPP, Cygwin,
   > > BSD etc.
   > 
   > Could you please identify the tests in the test suite, or post a short
   > test program and a GDB session script, that could be used to test this
   > problem?

   Sure.  
   make check RUNTESTFLAGS=callfuncs.exp
   FAIL: gdb.base/callfuncs.exp: p t_float_values(3.14159,-2.3765)
   FAIL: gdb.base/callfuncs.exp: p t_float_values(float_val1,float_val2)
   FAIL: gdb.base/callfuncs.exp: p t_float_values(3.14159,float_val2)
   FAIL: gdb.base/callfuncs.exp: p t_float_values(float_val1,-2.3765)
   FAIL: gdb.base/callfuncs.exp: p t_float_values2(3.14159,float_val2)

I don't see those failures on Linux.  Calling functions that use the
FPU doesn't work reliably on the Hurd right now.

   The problem is that GDB passes the float values as floats, 
   while the callee expects them to be doubles.

Are you sure?  I already said that things appear to be working fine on
Linux, and the System V ABI says that single-precision floating-point
arguments occupy a single word on the stack.

Mark


More information about the Gdb-patches mailing list