* [RFA] mips eabi, passing corner-case structs
@ 2006-05-31 23:55 Michael Snyder
2006-06-08 19:17 ` Michael Snyder
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Michael Snyder @ 2006-05-31 23:55 UTC (permalink / raw)
To: Joel Brobecker, GDB Patches, Fred Fish
[-- Attachment #1: Type: text/plain, Size: 129 bytes --]
That odd little corner case in eabi, wherein structs whose
single field is a float or double are passed like a float or double.
[-- Attachment #2: d5 --]
[-- Type: text/plain, Size: 1481 bytes --]
2006-05-31 Michael Snyder <msnyder@redhat.com>
* mips-tdep.c (mips_eabi_push_dummy_call): Catch corner case,
structs with a single field of floating point type.
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));
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [RFA] mips eabi, passing corner-case structs
2006-05-31 23:55 [RFA] mips eabi, passing corner-case structs Michael Snyder
@ 2006-06-08 19:17 ` Michael Snyder
2006-06-09 18:16 ` Joel Brobecker
2006-06-17 23:41 ` Mark Kettenis
2 siblings, 0 replies; 5+ messages in thread
From: Michael Snyder @ 2006-06-08 19:17 UTC (permalink / raw)
To: GDB Patches; +Cc: Joel Brobecker, Fred Fish
Ping?
Michael Snyder wrote:
> That odd little corner case in eabi, wherein structs whose
> single field is a float or double are passed like a float or double.
>
>
> ------------------------------------------------------------------------
>
> 2006-05-31 Michael Snyder <msnyder@redhat.com>
>
> * mips-tdep.c (mips_eabi_push_dummy_call): Catch corner case,
> structs with a single field of floating point type.
>
> 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));
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [RFA] mips eabi, passing corner-case structs
2006-05-31 23:55 [RFA] mips eabi, passing corner-case structs Michael Snyder
2006-06-08 19:17 ` Michael Snyder
@ 2006-06-09 18:16 ` Joel Brobecker
2006-06-17 23:41 ` Mark Kettenis
2 siblings, 0 replies; 5+ messages in thread
From: Joel Brobecker @ 2006-06-09 18:16 UTC (permalink / raw)
To: Michael Snyder; +Cc: GDB Patches, Fred Fish
> That odd little corner case in eabi, wherein structs whose
> single field is a float or double are passed like a float or double.
>
> 2006-05-31 Michael Snyder <msnyder@redhat.com>
>
> * mips-tdep.c (mips_eabi_push_dummy_call): Catch corner case,
> structs with a single field of floating point type.
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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [RFA] mips eabi, passing corner-case structs
2006-05-31 23:55 [RFA] mips eabi, passing corner-case structs Michael Snyder
2006-06-08 19:17 ` Michael Snyder
2006-06-09 18:16 ` Joel Brobecker
@ 2006-06-17 23:41 ` Mark Kettenis
2006-06-20 20:21 ` Daniel Jacobowitz
2 siblings, 1 reply; 5+ messages in thread
From: Mark Kettenis @ 2006-06-17 23:41 UTC (permalink / raw)
To: msnyder; +Cc: brobecker, gdb-patches, fnf
> Date: Wed, 31 May 2006 16:46:51 -0700
> From: Michael Snyder <msnyder@redhat.com>
>
> That odd little corner case in eabi, wherein structs whose
> single field is a float or double are passed like a float or double.
Is the MIPS eabi documented somewhere? Or are you just implementing
whatever the GCC du jour emits? Doesn't your fix also affect structs
that have a single "long long" field?
> 2006-05-31 Michael Snyder <msnyder@redhat.com>
>
> * mips-tdep.c (mips_eabi_push_dummy_call): Catch corner case,
> structs with a single field of floating point type.
>
> 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));
>
> --------------090500030309010101070908--
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [RFA] mips eabi, passing corner-case structs
2006-06-17 23:41 ` Mark Kettenis
@ 2006-06-20 20:21 ` Daniel Jacobowitz
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2006-06-20 20:21 UTC (permalink / raw)
To: Mark Kettenis; +Cc: msnyder, brobecker, gdb-patches, fnf
On Sun, Jun 18, 2006 at 01:41:33AM +0200, Mark Kettenis wrote:
> > Date: Wed, 31 May 2006 16:46:51 -0700
> > From: Michael Snyder <msnyder@redhat.com>
> >
> > That odd little corner case in eabi, wherein structs whose
> > single field is a float or double are passed like a float or double.
>
> Is the MIPS eabi documented somewhere? Or are you just implementing
> whatever the GCC du jour emits? Doesn't your fix also affect structs
> that have a single "long long" field?
The MIPS "EABI" is not documented anywhere, as far as I know. It was a
Cygnus invention; the best I know of offhand is:
http://sources.redhat.com/ml/binutils/2003-06/msg00436.html
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-06-20 20:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-31 23:55 [RFA] mips eabi, passing corner-case structs Michael Snyder
2006-06-08 19:17 ` Michael Snyder
2006-06-09 18:16 ` Joel Brobecker
2006-06-17 23:41 ` Mark Kettenis
2006-06-20 20:21 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox