-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
RISC-V inline assembly ignores input register constraints #60391
Comments
I have looked deeper into this and the issue lies both with your inline asm call, and with the LLVM backend. On the one hand, as documented in https://llvm.org/docs/LangRef.html#constraint-codes (which the rust asm macro is a thin shim on top of), However, this bug also shows the same underlying issue as #60392. If you specify |
Correction: The constraint code set Update: Looking at the code in LLVM, when you specify a constraint set, it will always try to choose the most general constraint, and doesn't have enough information at that moment to work out if the constraints overlap. This means if you specify |
I have just landed https://reviews.llvm.org/rL368303, which solves the bug where you can only use the architectural register names. This has not been back-ported to 9.0, so may take some time to arrive in Rust. For the moment, use the architectural names. |
This issue does not apply to the new The legacy |
This code:
When compiled for the riscv64imac target:
Ignores the input register constraints which say to use
sp
andt0
(defaulting to a0 and a1 instead):The text was updated successfully, but these errors were encountered: