-
Notifications
You must be signed in to change notification settings - Fork 22
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
Calling convention for arguments on the stack on Xtensa is incorrect for arguments narrower than 32 bits (LLVM-245) #66
Comments
@andreisfr Sorry for the direct ping but it seems like you committed the relevant code. Do you have any idea of what kind of timeline we're looking at to get this fixed? Would be good to have this ABI incompatibility resolved. |
This issue has also been reported internally |
@igrr Ping? |
Hi @kyrias , we preparing patch now with fixes, I hope in a few days we will update current version. |
@kyrias , we applied fixes, PTAL. |
@andreisfr The generated code from the |
Should be fixed in df98377 and included into esp-16.0.0-20230515 release. @kyrias Can we close this issue? |
According to the ISA document function arguments passed on the stack are all essentially stored in 32-bit slots, which matches how GCC for Xtensa behaves. Meanwhile LLVM for Xtensa passes smaller arguments packed together. This means that passing more than 6 arguments to a function between code compiled by GCC and LLVM is currently broken.
E.g.:
I see in
CC_Xtensa_Custom
thati8
andi16
are promoted toi32
for non-byval arguments:llvm-project/llvm/lib/Target/Xtensa/XtensaISelLowering.cpp
Lines 744 to 753 in 1e28f73
But the same promotion s not being done for byval ones:
llvm-project/llvm/lib/Target/Xtensa/XtensaISelLowering.cpp
Lines 733 to 742 in 1e28f73
I was considering trying to submit a patch for this, but I'm not sure if you're currently accepting patches for the Xtensa part, or if so how you're accepting them.
The text was updated successfully, but these errors were encountered: