This is the mail archive of the gcc-patches@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]

Re: [split] Add CFI ops, fix call/return prediction, other changes


On 09/30/2009 05:15 PM, Ian Lance Taylor wrote:
Paolo Bonzini<bonzini@gnu.org> writes:

movl 4(%ebp), %eax # Increment return address
inc %eax
movl %eax, -8(%ebp) # Store it in an unused slot

movl -4(%ebp), %eax # Restore 3rd register

call *-8(%ebp) # Call our caller via slot

Also, would it make sense to reserve 3 bytes for the ret, so that stdcall functions could have split stack? Alternatively, you need to disable split stack (with a sorry) for stdcall functions.

stdcall functions don't work yet, but this isn't why. The ret we're skipping here is just magic inserted to make the call/return predictor line up. It's really the split_stack_return insn, not a regular return. The actual stack popping ret is at the end of the function as usual.

Yes, understood. But for stdcall functions to work you need a stack-popping ret here too (you are returning to the caller and need to clean up your arguments). This would consume more than one byte.


Paolo


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