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]

Is the parameters stored on the stack preserved across function calls or volatile in the ABI of intel386 & amd64


Hi,

Is the parameters stored on the stack preserved across function calls or
volatile in the ABI of intel386 & amd64?

I think the answer should be 'volatile' because gcc sometimes did modify
them in the callee but couldn't found any description about it in the
specifications of Sys V ABI intel386 & amd64.

Example:

void* get(void* i){ void**p = &i; *p=(void*)0; return p; }

gcc yields:(elf32-i386)

push   ebp
mov    ebp,esp
sub    esp,0x10
lea    eax,[ebp+0x8]
mov    DWORD PTR [ebp-0x4],eax
mov    eax,DWORD PTR [ebp-0x4]
mov    DWORD PTR [eax],0x0
mov    eax,DWORD PTR [ebp-0x4]
leave
ret

Thanks a lot.


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