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]

Returning structs on Linux-i386


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!

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