This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Returning structs on Linux-i386
- To: gcc at gcc dot gnu dot org
- Subject: Returning structs on Linux-i386
- From: Erik Corry <corry at daimi dot au dot dk>
- Date: Mon, 17 Apr 2000 13:43:37 +0200
- Cc: ctm at ardi dot com
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!