https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103088
--- Comment #22 from rguenther at suse dot de <rguenther at suse dot de> --- On Fri, 19 Nov 2021, aldyh at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103088 > > --- Comment #19 from Aldy Hernandez <aldyh at gcc dot gnu.org> --- > > The problem is this construct in Perl_do_ncmp: > > if (lnv < rnv) > return -1; > if (lnv > rnv) > return 1; > if (lnv == rnv) > return 0; > return 2; > > These are all doubles. The code is depending on a pair of values that are > neither <, >, nor ==, being a NAN. It would be nice from a QOI point of view (aka DWIM) that even with -ffast-math we'd recognize this as a form of FP classification since "obviously" the intent was to handle the NaN special case. Not that I see any reasonable way to represent the NaN case in -ffast-math IL ... > I think we can keep this PR closed. Don't use -ffast-math unless followed by > -fno-unsafe-math-optimizations. Agreed.