-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[libc] implicit conversion error on rv32 #138425
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-libc Author: Mikhail R. Gadelha (mikhailramalho)
Some tests are failing to build on rv32 due to:
```
/home/mgadelha/tools/llvm-project/libc/src/__support/FPUtil/FPBits.h:760:40: error: implicit conversion loses integer precision: 'int' to 'size_t' (aka 'unsigned int') [-Werror,-Wimplicit-int-conversion]
760 | result.set_significand(number >> -ep);
| ~~ ^~~
/home/mgadelha/tools/llvm-project/libc/src/__support/FPUtil/generic/FMod.h:221:19: note: in instantiation of member function '__llvm_libc_21_0_0_git::fputil::internal::FPRepImpl<__llvm_libc_21_0_0_git::fputil::FPType::IEEE754_Binary128, __llvm_libc_21_0_0_git::fputil::FPBits<long double>>::make_value' requested here
221 | return FPB::make_value(d, e_y - 1);
| ^
/home/mgadelha/tools/llvm-project/libc/src/__support/FPUtil/generic/FMod.h:286:18: note: in instantiation of member function '__llvm_libc_21_0_0_git::fputil::generic::FMod<long double>::eval_internal' requested here
286 | FPB result = eval_internal(sx, sy);
| ^
/home/mgadelha/tools/llvm-project/libc/src/math/generic/fmodl.cpp:17:46: note: in instantiation of member function '__llvm_libc_21_0_0_git::fputil::generic::FMod<long double>::eval' requested here
17 | return fputil::generic::FMod<long double>::eval(x, y);
| ^
1 error generated.
```
|
This fixed it for me, but I'm not sure it's the right fix:
|
I think the correct fix should have the minus sign inside the cast. To reach this line the value of |
Yes, the minus sign should be inside the cast. And probably we should use |
static_cast(-ep) builds without issue, running the experiments now. |
This patch fixes the following error on rv32 (and possibly other 32-bit archs): FPBits.h:760:40: error: implicit conversion loses integer precision: 'int' to 'size_t' (aka 'unsigned int') [-Werror,-Wimplicit-int-conversion] 760 | result.set_significand(number >> -ep); Fixes llvm#138425.
This patch fixes the following error on rv32 (and possibly other 32-bit archs): FPBits.h:760:40: error: implicit conversion loses integer precision: 'int' to 'size_t' (aka 'unsigned int') [-Werror,-Wimplicit-int-conversion] 760 | result.set_significand(number >> -ep); Fixes #138425.
This patch fixes the following error on rv32 (and possibly other 32-bit archs): FPBits.h:760:40: error: implicit conversion loses integer precision: 'int' to 'size_t' (aka 'unsigned int') [-Werror,-Wimplicit-int-conversion] 760 | result.set_significand(number >> -ep); Fixes llvm#138425.
Some tests are failing to build on rv32 due to:
The text was updated successfully, but these errors were encountered: