Closed
Description
The compiler optimizes x * 1.0
to x
, which is incorrect whenever x
is a signaling NaN. IEEE 754 mandates that the result is a quiet NaN.
Example (rustc 1.66, with -C opt-level=2
): https://godbolt.org/z/5qa5Go17M
This is almost certainly an LLVM bug. It's been filed over there under llvm/llvm-project#43070. I don't know which optimization pass is responsible for it.