This is the mail archive of the gcc-help@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]
Other format: [Raw text]

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


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