https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71921
--- Comment #18 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Arjan van de Ven from comment #17) > (In reply to Andrew Pinski from comment #15) > > Read https://gcc.gnu.org/ml/gcc-patches/2015-08/msg00693.html also. There > > is much more to that thread than just in August IIRC. Some in September and > > in October too. > > I understand the argument, but if that is true, wouldn't it be unsafe to use > vmaxss as well, which gcc DOES generate? Your argument is the opposite way around. MIN_EXPR/MAX_EXPR does not specify the behavior with respect to NaNs so using vmaxss here is ok. But doing the conversion without -ffast-math to MIN/MAX EXPR won't work in general. There are some other passes which will use that the fact it is not specified and optimizing in correctly. Or other targets which might emit MIN/MAX_EXPR differently from x86. GCC is not just about x86.