This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
x86: big structure return
- From: Cezar Harabula <cezar dot harabula at open-plug dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 26 May 2004 14:04:40 +0200
- Subject: x86: big structure return
Hi,
I work with both GCC and VC6 compilers and I have a return incompatibility:
When a function returns a big structure (>8 bytes), there is not enough
space in registers, so this big structure is transmitted by address (an
address in EAX); this address was previously taken from the top of the
stack. The difference between GCC and VC6 is the following:
VC6 exits with
ret
GCC exits with
ret 4
(unwinds the stack; the 4 bytes which are popped represent that address
for the structure to be returned, proposed to the callee).
My question: how to impose to GCC not to pop that dword?
I tried with
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
in the body of my main.c, but the dissassembled code is the same :-(
Cezar