[rfc] mips-tdep.c: Make an explicit check for EABI32 in mips_eabi_push_dummy_call()

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[rfc] mips-tdep.c: Make an explicit check for EABI32 in mips_eabi_push_dummy_call()

Kevin Buettner
While looking at some mips64 test results recently, I found that
"callfuncs.exp: p t_double_values(0.0,0.0)" was failing for the
EABI32 multilibs.  The patch below fixes this failure and several
others as well.

Comments?

        * mips-tdep.c (mips_eabi_push_dummy_call): When pushing floating
        point arguments, test explicitly for use of the EABI32 ABI
        instead of inferring this condition from tests on register
        sizes.

Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.414
diff -u -p -r1.414 mips-tdep.c
--- mips-tdep.c 18 Apr 2007 08:22:33 -0000 1.414
+++ mips-tdep.c 27 Apr 2007 21:15:34 -0000
@@ -2507,7 +2507,12 @@ mips_eabi_push_dummy_call (struct gdbarc
       if (fp_register_arg_p (typecode, arg_type)
   && float_argreg <= MIPS_LAST_FP_ARG_REGNUM)
  {
-  if (register_size (gdbarch, float_argreg) < 8 && len == 8)
+  /* EABI32 will pass doubles in consecutive registers, even on
+     64-bit cores.  At one time, we used to check the size of
+     `float_argreg' to determine whether or not to pass doubles
+     in consecutive registers, but this is not sufficient for
+     making the ABI determination.  */
+  if (len == 8 && mips_abi (gdbarch) == MIPS_ABI_EABI32)
     {
       int low_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 4 : 0;
       unsigned long regval;

Reply | Threaded
Open this post in threaded view
|

Re: [rfc] mips-tdep.c: Make an explicit check for EABI32 in mips_eabi_push_dummy_call()

Kevin Buettner
On Fri, 27 Apr 2007 14:30:44 -0700
Kevin Buettner <[hidden email]> wrote:

> * mips-tdep.c (mips_eabi_push_dummy_call): When pushing floating
> point arguments, test explicitly for use of the EABI32 ABI
> instead of inferring this condition from tests on register
> sizes.

I've committed this change.

Kevin