This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rfa:ppc] Fix PPC/NBSD struct return; Was: userdef.exp regression for ppc?


On Sun, Jun 02, 2002 at 11:51:05AM -0700, Jason R Thorpe wrote:
> On Sat, Jun 01, 2002 at 01:21:52PM -0400, Andrew Cagney wrote:
> 
>  > Yep!  The attached fixes it.  Looks like PPC/NetBSD's custom GCC has a 
>  > fixed struct return (I'm pretty sure that mainline GCC is broken).
> 
> Hmmmmm, both our 2.91 and 2.95 based compilers use:
> 
> #define RETURN_IN_MEMORY(TYPE)                                          \
>   (TYPE_MODE (TYPE) == BLKmode                                          \
>      && (DEFAULT_ABI != ABI_SOLARIS || int_size_in_bytes (TYPE) > 8))
> 
> ...and don't override this anywhere.  The DEFAULT_ABI ends up as ABI_V4,
> and not ABI_SOLARIS, so we definitely should be using the AIX structure
> return convention there.
> 
> However, the following:
[...]
> ...does indeed produce code that appears to follow the SVR4 ABI rules:
[...]
> AHA!  I see why.  In the 2.91 and 2.95 compilers, config/netbsd.h
> defines DEFAULT_PCC_STRUCT_RETURN to 0, which causes GCC's
> aggregate_value_p() to effecively give the SVR4 ABI semantics.
> 
> Yes, gcc 3.1 and gcc-current are definitely broken in this regard for
> NetBSD, then (I haven't had a chance to do much gcc work on powerpc-netbsd,
> but I'm obviously going to have to pay a bit more attention to it now).

I'm a little confused here.  Are you saying that the 2.9x native GCC
for NetBSD followed the SVR4 spec, returning small structures in
registers, but 3.1 and -current don't (because I incorrectly thought
the earlier compilers used the AIX convention)?  If so, the fix should
be as simple as removing the

/* For backward compatibility, we must continue to use the AIX
   structure return convention.  */
#undef DRAFT_V4_STRUCT_RET
#define DRAFT_V4_STRUCT_RET 1

from gcc/config/rs6000/netbsd.h...

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]