Possible bug in PowerPC structure passing

Michael Meissner meissner@cygnus.com
Tue Apr 4 16:00:00 GMT 2000


On Tue, Apr 04, 2000 at 01:58:41PM -0800, Stan Shebs wrote:
> Apple is switching from using EGCS 1.1.2 to GCC 2.95.2 for building
> MacOS X, and has encountered a number of regressions.  One of them
> is that passing medium-sized structures by value doesn't work,
> because memcpy's result steps on the save area (which then causes
> OS X networking stack to fall over).  I've included a small test
> case below.  I'm not 100% certain this is a GCC bug, because we
> have a lot of local mods and no AIX systems to test with; however,
> if I'm on a PowerPC Linux system and compile the test case with
> 
>    gcc -mcall-aix -O -c dek.c
>    gcc dek.o
> 
> then 1.1.2 (the default on my Linux system) wins, while 2.95.2 and
> yesterday's checkout both lose.  You need -mcall-aix to emulate the
> MacOS calling convention, -mcall-sysv doesn't seem to have a problem.
> 
> So if some kind person could try this out on a real AIX system and
> report back, I'd be very grateful.

Try -mno-string and see if it helps.  In theory, -mno-string is on by default
when you configure the compiler for a PowerPC instead of a Power based
computer, but it doesn't hurt the try.  If -mstring is enabled (or if your
build procedures use that option), then the compiler uses fixed registers (gr6
.. gr12) for the string loads and stores.

-- 
Michael Meissner, Cygnus Solutions, a Red Hat company.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482


More information about the Gcc mailing list