x86: big structure return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux