-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Subnormal f64 to f32 cast is incorrect in CTFE #113407
Comments
This is strange: https://godbolt.org/z/14GxTsfoM LLVM and Rust are both using apfloat for compile-time float computations, and yet the MIR opts produce 1 and LLVM produces 0. Is this something that was fixed in upstream apfloat but we don't have the fix yet? |
Rust's apfloat port is old and unupdated for a long while. For instance #102403 was fixed upstream 6 years ago llvm/llvm-project@f2c2851 |
The relevant fix is probably https://reviews.llvm.org/D127140? |
#113416 should work around this. |
While trying to trigger a different issue involving float<->float conversions, I believe my (which is good confirmation that we can find such things. too bad about the FMA NaNs polluting fuzzer outputs) EDIT: also see the longer update post at #55993 (comment) |
As per #55993 (comment), this is now fixed in |
This should be reopened until rustc starts using the stand-alone crate |
Uh oh I did not do that, GH must've gotten overzealous cross-repo. |
You said "fixes #113407" in that PR, GH did the rest. ;) |
It should print
0
andtrue
, according to the equivalent C program: https://godbolt.org/z/7Gq51a1YhThis is probably another apfloat bug
(reproducible on x86 as well)
cc @eddyb @wesleywiser @RalfJung
The text was updated successfully, but these errors were encountered: