This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


   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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]