[llvm-bugs] [Bug 33510] Clang ignores NANs with -ffast-math and -fhonor-nans (or -fno-finite-math-only)

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 19 13:11:34 PST 2021


Andy Kaylor <andrew.kaylor at intel.com> changed:

           What    |Removed                     |Added
         Resolution|---                         |FIXED
                 CC|                            |andrew.kaylor at intel.com
             Status|NEW                         |RESOLVED

--- Comment #8 from Andy Kaylor <andrew.kaylor at intel.com> ---
I came across this while looking for something else. All the issues here seem
to be fixed.

clang -O2 -ffast-math -fhonor-nans

define dso_local i32 @testfunc(float %0) local_unnamed_addr #0 {
  %2 = fcmp reassoc ninf nsz arcp contract afn ord float %0, 0.000000e+00
  %3 = zext i1 %2 to i32
  ret i32 %3

attributes #0 = { mustprogress nofree norecurse nosync nounwind readnone
uwtable willreturn "approx-func-fp-math"="true"
"denormal-fp-math-f32"="ieee,ieee" "frame-pointer"="none"
"min-legal-vector-width"="0" "no-infs-fp-math"="true"
"no-signed-zeros-fp-math"="true" "no-trapping-math"="true"
"stack-protector-buffer-size"="8" "target-cpu"="x86-64"
"target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic"
"unsafe-fp-math"="true" }

Similarly correct for other combinations of flags.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211119/570f1499/attachment.html>

More information about the llvm-bugs mailing list