https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106785
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- If !MODE_HAS_NANS, then NANs can't appear ever, that is the VAX case. Some floating point formats simply have no representation for those. If MODE_HAS_NANS && !HONOR_NANS, it is user promising NaNs won't appear but the floating point format supports them. Code where NaN would appear is UB, we can do anything we want, just shouldn't break code where the NaN wouldn't appear at runtime. Say if (cond) x = __builtin_nan (""); else x = 1.24; we can assume that x will never be NaN with -ffinite-math-only.