-
Notifications
You must be signed in to change notification settings - Fork 22
Call ABI broken for >=7 arguments with commit ae26b7e4e! (LLVM-73) #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @arjanmels ! Thank you very much for reported problem. Could I ask you to attach llvm IR file and compiler arguments to reproduce the problem with broken abi? We have created some test coverage for ABI functionality and now I verified similar example with latest version of project (I've downloaded and built it from scratch): int abi_test(int a1, int a2, int a3, int a4, int a5, int a6, int a7)
} the result of compilation with options "-target xtensa -mcpu=esp32 -Os -S test.c -o test.S" is like this: abi_test: There is still some redundant mov instructions, but last argument is loaded from stack. Our call abi testsuite probably not cover all cases, so we can correct the problem, once we will be able to reproduce it. Thanks again. |
The IR is in both cases identical:
Hope this helps. |
I also ran the c version through clang and confirm I get the same assembly code as you do. When I generate llvm-IR, I get below. It looks like clang handles the call ABI here (last argument is a pointer).
|
@andreisfr Hi, was the supplied info useful and sufficient? |
Hi, @arjanmels! I can reproduce the problem now, thank you very much! |
Is there any update on this? This prevents me from using newest version. |
Hi @arjanmels ! Please verify new version 10.0.1, this error should be corrected now. |
With the latest commit ae26b7e, the call abi got broken for functions with 7 or more arguments.
Rust example:
Generated asm in release mode (debug mode has same problem, but generates a lot of check code):
As you can see the 7th argument is not retrieved from the stack, but a direct "add.n a2,a8,a9" is done (a9 is the address in memory).
(Also I wonder what the mov.n a8,a1 does at the start, it seem superfluous.)
With the previous commit (a5a002f) the resulting code was:
Notice the l32i.n instead of addi
The text was updated successfully, but these errors were encountered: