Returning structs on Linux-i386

Erik Corry corry@daimi.au.dk
Mon Apr 17 04:43:00 GMT 2000


Hi,

It seems that the way of returning structs from functions changed
between gcc-2.7.3 and egcs-1.1 under Linux.  It works by the caller
giving the address of the struct as an invisible 1st parameter.
In older versions of gcc the caller was expected to pop that address
off the stack again, now the callee does it automatically.

This change broke the C language ABI for Linux :-(.  It was also
noted in http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=2809
The good thing is that it brings Linux into line with the System V
ABI specs, though there are so many non-calling-convention differences
between the SVABI and Linux that it seems a small gain.

Was there a good reason?  Is it going to change back?  Is there
a general policy of trying to avoid such changes?

I haven't seen any discussion of that change here so perhaps it
predates egcs.

-- 
Erik Corry erik@arbat.com     Ceterum censeo, Microsoftem esse delendam!


More information about the Gcc mailing list