This is the mail archive of the
mailing list for the GCC project.
Re: x86_64 varargs setup jump table
Richard Henderson <email@example.com> writes:
> On 07/17/2010 07:25 AM, Bernd Schmidt wrote:
>> leaq 0(,%rax,4), %rcx
>> movl $.L2, %eax
>> subq %rcx, %rax
>> jmp *%rax
> I've often thought this was over-engineering in the x86_64 abi.
> This jump table is trading memory bandwidth for unpredictability
> in the branch target.
The other problem with the jump is that if you misdeclare
the prototype and nothing correct is passed in %eax
then you get a random jump somewhere which tends to be hard
to debug. This has happened in the past when porting
Just alone getting rid of that would be worth changing it.
varargs shouldn't be that time critical anyways
firstname.lastname@example.org -- Speaking for myself only.