-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Clang MIPS: float register constraints for inline asm deviate from gcc #64241
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
@llvm/issue-subscribers-backend-mips |
Note the |
Should we consider it as a bug of gcc or clang ;) |
Note with -msoft-float on clang, it is rejected too. Though there is an internal compiler error and that is definitely a bug. |
Ohh, I know. Let me have a try. |
Currently, clang accpets contraint f for softfloat, then LLVM meet an internal error. See: llvm#64241
This PR fixes half of this problem: no-ICE if f is used for soft-float. We also need to support r for soft-float. |
This include 2 fixes: 1. Disallow 'f' for softfloat. 2. Allow 'r' for softfloat. Currently, 'f' is accpeted by clang, then LLVM meet an internal error. 'r' is rejected by LLVM by: couldn't allocate input reg for constraint 'r' Fixes: llvm#64241
can solve the whole of problem now. |
This include 2 fixes: 1. Disallow 'f' for softfloat. 2. Allow 'r' for softfloat. Currently, 'f' is accpeted by clang, then LLVM meet an internal error. 'r' is rejected by LLVM by: couldn't allocate input reg for constraint 'r' Fixes: llvm#64241
This include 2 fixes: 1. Disallow 'f' for softfloat. 2. Allow 'r' for softfloat. Currently, 'f' is accpeted by clang, then LLVM meet an internal error. 'r' is rejected by LLVM by: couldn't allocate input reg for constraint 'r' Fixes: llvm#64241
This include 2 fixes: 1. Disallow 'f' for softfloat. 2. Allow 'r' for softfloat. Currently, 'f' is accpeted by clang, then LLVM meet an internal error. 'r' is rejected by LLVM by: couldn't allocate input reg for constraint 'r' Fixes: llvm#64241
This include 2 fixes: 1. Disallow 'f' for softfloat. 2. Allow 'r' for softfloat. Currently, 'f' is accpeted by clang, then LLVM meet an internal error. 'r' is rejected by LLVM by: couldn't allocate input reg for constraint 'r' Fixes: llvm#64241
This include 2 fixes: 1. Disallow 'f' for softfloat. 2. Allow 'r' for softfloat. Currently, 'f' is accpeted by clang, then LLVM meet an internal error. 'r' is rejected by LLVM by: couldn't allocate input reg for constraint 'r' Fixes: llvm#64241
This include 2 fixes: 1. Disallow 'f' for softfloat. 2. Allow 'r' for softfloat. Currently, 'f' is accpeted by clang, then LLVM meets an internal error. 'r' is rejected by LLVM by: couldn't allocate input reg for constraint 'r'. Fixes: #64241, #63632 --------- Co-authored-by: Fangrui Song <i@maskray.me>
This include 2 fixes: 1. Disallow 'f' for softfloat. 2. Allow 'r' for softfloat. Currently, 'f' is accpeted by clang, then LLVM meets an internal error. 'r' is rejected by LLVM by: couldn't allocate input reg for constraint 'r'. Fixes: llvm#64241, llvm#63632 --------- Co-authored-by: Fangrui Song <i@maskray.me> (cherry picked from commit c88beb4)
This include 2 fixes: 1. Disallow 'f' for softfloat. 2. Allow 'r' for softfloat. Currently, 'f' is accpeted by clang, then LLVM meets an internal error. 'r' is rejected by LLVM by: couldn't allocate input reg for constraint 'r'. Fixes: llvm#64241, llvm#63632 --------- Co-authored-by: Fangrui Song <i@maskray.me> (cherry picked from commit c88beb4)
clang and gcc seem to have different behavior of floating point constraints for inline asm targetting MIPS. Consider this simple example
The following code compiles fine on gcc when targeting MIPS, but clang gives a compile error
couldn't allocate input reg for constraint 'r'
Clang requires the register constraint here to be
"f"
not"r"
. However applying an"f"
constraint, causes gcc to fail compilation with the errorerror: impossible constraint in 'asm'
while clang compiles the code fine.Here is a simple demo of the issue: https://godbolt.org/z/WGWxd3ejo
Test with "mips gcc 13.1.0" and "mips clang 16.0.0"
(This bug was discovered as part of the wasm2c project WebAssembly/wabt#2266)
The text was updated successfully, but these errors were encountered: