Re: [RFA] mips eabi, passing corner-case structs

Joel Brobecker
2006-06-09T18:16:55Z

I have been trying to convince myself that it's ok to not verify
that the unique field inside the struct is not a float. It looks
OK to me, but do you confirm as well?

The patch seems OK to me, but could you merge the two comments instead
of adding one right after the current one. Also, there is a missing "s"
in "unless". The indenting seems a bit odd in the diff, but I imagine
this is because of tabulations (when are we going to get rid of these
horros...).

Thanks,

> Index: mips-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/mips-tdep.c,v
> retrieving revision 1.393
> diff -p -r1.393 mips-tdep.c
> *** mips-tdep.c 31 May 2006 23:15:50 -0000 1.393
> --- mips-tdep.c 31 May 2006 23:44:31 -0000
> *************** mips_eabi_push_dummy_call (struct gdbarc
> *** 2453,2460 ****
>
> /* The EABI passes structures that do not fit in a register by
> reference. */
> ! if (len > mips_abi_regsize (gdbarch)
> ! && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION))
> {
> store_unsigned_integer (valbuf, mips_abi_regsize (gdbarch),
> VALUE_ADDRESS (arg));
> --- 2453,2467 ----
>
> /* The EABI passes structures that do not fit in a register by
> reference. */
> ! /* MVS: unles the struct has only one field, and that field
> ! will fit into two registers. */
> ! if ((typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)
> ! && TYPE_NFIELDS (arg_type) == 1
> ! && len == 2 * mips_abi_regsize (gdbarch))
> ! val = value_contents (arg);
> ! else if (len > mips_abi_regsize (gdbarch)
> ! && (typecode == TYPE_CODE_STRUCT
> ! || typecode == TYPE_CODE_UNION))
> {
> store_unsigned_integer (valbuf, mips_abi_regsize (gdbarch),
> VALUE_ADDRESS (arg));

--
Joel