Issue |
98934
|
Summary |
x86 CodeGen Question: Why is eax set to zero before function calls?
|
Labels |
new issue
|
Assignees |
|
Reporter |
Toni-Graphics
|
Hi,
I experimented a little bit with clang in godbold: [https://godbolt.org/z/GnvM4jKxM](https://godbolt.org/z/GnvM4jKxM)
I came across that there is a `xor eax, eax` before each function is called. Why is that?
Eax is no argument register. And the printf function doesn't depend on the content of eax.
Also max optimizations are turned on (-O3)
(In the godbold; the right tab; line 5 and 14)
Note: If i am understanding something here wrong please let me know that
Bye
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs