https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114140
--- Comment #14 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to g.peterhoff from comment #13) > > The cppreference page is wrong. > But then *all* of your implementations for fmin/fmax (float, double, long > double, std::floatN_t) would be wrong, because they give exactly the results > as described on cppreference. > Is this really the case (which I don't believe)? And if so, that still > doesn't solve the original problem: std::math-functions and > quadmath-functions *must* of course return the same results - no matter > which implementation is correct. Again read what I mentioned, adding -fsignaling-nans changes the behavior of std::fmin/fmax even for float/double,etc. As I mentioned, it is about constant folding of fmin (inside the compiler) vs what the function actually does. > Is this really the case (which I don't believe)? You can test it yourself by changing const to volatile and you will see it is different in the middle-end's constant folding vs libc's version. libc (and libquadmath) version is correct based on those 2 sourceware issues. The question becomes is the constant folding version correct without -fsignaling-nans ?