This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[patch/mips] Fix simple floating-point struct for eabi
- To: GDB Patches <gdb-patches at sourceware dot cygnus dot com>
- Subject: [patch/mips] Fix simple floating-point struct for eabi
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Sun, 18 Jun 2000 00:34:50 +1000
- Organization: Cygnus Solutions
FYI,
The attatched fixes the case where GDB is calling an inferior function
with a structure containing just a single floating point value. The
EABI likes to squeeze it into a floating-point register.
Andrew
Sun Jun 18 00:27:15 2000 Andrew Cagney <cagney@b1.cygnus.com>
* mips-tdep.c (mips_push_arguments): For MIPS_EABI, squeeze a
strut containing a floating-point into an FP register.
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.18
diff -p -r1.18 mips-tdep.c
*** mips-tdep.c 2000/06/17 05:42:50 1.18
--- mips-tdep.c 2000/06/17 14:29:01
*************** mips_push_arguments (nargs, args, sp, st
*** 2143,2149 ****
don't use float registers for arguments. This duplication of
arguments in general registers can't hurt non-MIPS16 functions
because those registers are normally skipped. */
! if (typecode == TYPE_CODE_FLT
&& float_argreg <= MIPS_LAST_FP_ARG_REGNUM
&& MIPS_FPU_TYPE != MIPS_FPU_NONE)
{
--- 2143,2156 ----
don't use float registers for arguments. This duplication of
arguments in general registers can't hurt non-MIPS16 functions
because those registers are normally skipped. */
! /* MIPS_EABI squeeses a struct that contains a single floating
! point value into an FP register instead of pusing it onto the
! stack. */
! if ((typecode == TYPE_CODE_FLT
! || (MIPS_EABI
! && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)
! && TYPE_NFIELDS (arg_type) == 1
! && TYPE_CODE (TYPE_FIELD_TYPE (arg_type, 0)) == TYPE_CODE_FLT))
&& float_argreg <= MIPS_LAST_FP_ARG_REGNUM
&& MIPS_FPU_TYPE != MIPS_FPU_NONE)
{