craig.topper added a comment. Doesn't gcc also fold isnan to false under fast math? If we diverge here that means your code would only work correctly with clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104854/new/ https://reviews.llvm.org/D104854