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?


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).

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>

Attachment: test.c
Description: Text document

Attachment: test.s-2.95.3-native
Description: Text document

Attachment: test.s-3.2-broken
Description: Text document

Attachment: test.s-3.2-working
Description: Text document


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