Admin message

Due to a large amount of spam we do not allow new users to create repositories, they are "external" users. If you are a new user and want to create a repository, for example for forking GHC, open a new issue on ghc/ghc using the "get-verified" issue template

On RISC-V, `castFloatToWord32` can generate bad, signed `Word32`s
## Summary With RISC-V NCG, `castFloatToWord32` can generate a signed `Word32`. There used to be a similar issue on x86_64 (#16617). ## Steps to reproduce ```haskell import GHC.Float {-# OPAQUE noinline #-} noinline :: a -> a noinline x = x main :: IO () main = do -- As per #16617, Word32s should be non-negative print $ castFloatToWord32 (noinline $ -1) print $ toInteger (castFloatToWord32 (noinline $ -1)) > 0 -- For completeness, so should Word64s print $ castDoubleToWord64 (noinline $ -1) print $ toInteger (castDoubleToWord64 (noinline $ -1)) > 0 ``` ``` $ ghc -fforce-recomp -O T16617a.hs $ ./T16617a -1082130432 True 13830554455654793216 True ``` We need to enable optimizations and disable constant folding to get the bad behavior. The existing test case (T16617) exhibits the problem with GHC 9.12.4+`--test-way=optasm`, but not with master. ## Expected behavior ``` $ ghc -fforce-recomp T16617a.hs $ ./T16617a 3212836864 True 13830554455654793216 True ``` ## Environment * GHC version used: 10.1.20260525 (cccf45da) and 9.12.4 * I haven't tested 9.14 and 10.0, but I suppose these versions are also affected. * Operating System: Bianbu 4.0 (an Ubuntu 26.04-based Linux distro) * System Architecture: 64-bit RISC-V
issue