This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: [patch/mips] Fix simple floating-point struct for eabi
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Subject: Re: [patch/mips] Fix simple floating-point struct for eabi
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Sat, 17 Jun 2000 14:26:57 -0700
- CC: GDB Patches <gdb-patches at sourceware dot cygnus dot com>
- Organization: Cygnus Solutions
- References: <394B8C8A.E65D4C38@cygnus.com>
- Reply-To: msnyder at cygnus dot com
Andrew Cagney wrote:
>
> 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.
Hmmm, I'll have to look at this! Sparc64 likes to do the same thing.
>
> 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)
> {