This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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?


Hi,

Thanks for your reply.  I will fix the OOo bridge code.

Two other questions if you have a second:

1. How are you currently handling the case when you call a function with 
more than 8 floating point (not double) values so that floating point 
values must be created on the outgoing parameter stack in the frame making 
the call?

The sys v abi says these float parameters should be passed as double values 
on the outgoing stack with addresses aligned to 8.

Currently ppc Linux does NOT follow this part of the abi and instead 
passing float parameters (after the 8 which are passed in f1-f8) as 
floating point (single) values aligned to 4.

What does NetBSD ppc do here?

2. What about returning unions (which would probably be exactly 8 bytes in 
size?  Are they treated like small structures or something different?

Thanks,

Kevin

On June 2, 2002 09:13, Jason R Thorpe wrote:
> On Sun, Jun 02, 2002 at 08:43:16PM -0400, Kevin B. Hendricks wrote:
>  > So based on what I have read this code may have to be modified for
>  > NetBSD ppc.
>
> I think your assumption is correct.
>
>  > To prevent confusion, please specifiy whether or not you are (or will
>  > be) using small structure returns in registers for any of
>  >
>  > gcc 2.95.X
>  > gcc 3.0.X
>  > gcc 3.1
>  >
>  > for NetBSD ppc.
>
> 2.95.x -- NetBSD/powerpc was not supported in the stock GCC 2.95.3
> release. The native in-tree compiler for NetBSD/powerpc, which is
> 2.95.3-based, returns small structures in registers.
>
> 3.0.x -- I don't know, I'd have to check.
>
> 3.1 -- *INCORRECTLY* returns small structures in memory.  3.1.1 will
> correct the problem, and return small structures in registers, to match
> the 2.95.3-based native in-tree compiler.
>
> Please consider "returns small structures in registers, per the SVR4
> ABI" to be the expected behavior for NetBSD/powerpc.
>
>  > Is there any value in keeping NetBSD PPC in sync with PPC Linux for
>  > these issues?  Does you decision here impact NetBSD's ppc ability to
>  > run PPC Linux binaries like the Blackdown JDK, etc under Linux
>  > emulation?
>
> No, running binaries under Linux emulation will not be affected, since
> those binaries are linked at run-time against Linux shared libraries.
>
>  > Either way I would appreciate knowing your plans so that I can fix
>  > the bridge code in NetBSD for ppc (for both gcc 3.X and gcc 2.95.X).
>
> See above.  If your bridge code for NetBSD/powerpc currently assumes the
> "return in memory" behavior of Linux, then it is incorrect.
>
> Attached are 4 files:
>
> 	test.c -- function which returns an 8 byte structure
>
> 	test.s-2.95.3-native -- asm output from the 2.95.3-based
> 	native compiler which will ship with NetBSD 1.6.  The output
> 	is the same as the 2.91-based compiler that NetBSD 1.5 shipped.
>
> 	test.s-3.2-broken -- asm output from gcc 3.1 and gcc-current
> 	before the compiler was fixed.
>
> 	test.s-3.2-working -- asm output from gcc 3.1(.1) and gcc-current
> 	after the compiler was fixed.
>
> Note that I have checked the necessary fix into the GCC mainline and
> the 3.1 branch (so the fix will be in 3.1.1).


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