void test();
void my_function()
{
test();
}
Result:
my_function:
xorl %eax, %eax
jmp test
Godbolt link:
https://godbolt.org/z/vhWejE
Why does GCC generate xorl %eax, %eax before tail call to test?
What is exactly the purpose of zeroing %eax in this situation?
Is there an ABI requirement for doing this?
Thanks.
Ah okay, I figured it out. It turns out to be an ABI requirement for determining the number of vector registers used. I did realize it when working with printf, but was no idea when random function takes unspecified number of arguments like this.
Обсуждают сегодня