[llvm-dev] (in x86, ) Use ebp or esp to access local variable? what's different?
PenYiWang via llvm-dev
llvm-dev at lists.llvm.org
Tue Jan 22 21:39:30 PST 2019
I use LLVM/Clang to compile some program.
I found that if we use -O0 flag, the program will use ebp to access local
For example : mov ecx,DWORD PTR [ebp-0x8]
If we use -O2 flag, the program will use esp to access local variables.
For example : mov eax,DWORD PTR [esp+0x8]
Is there any different between them?
Can user decide esp or ebp to access the local variable?
Or can I modify LLVM backend code to do it?
Is there any calling convention related to it?
I found it is the same in gcc.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev