https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103088
--- Comment #21 from Aldy Hernandez <aldyh at gcc dot gnu.org> --- One last comment. A smaller hammer than -fno-unsafe-math-optimizations may be -fno-finite-math-only which allows for the problematic NAN behavior in Perl_do_ncmp. Allowing for the inlining, but not munging the comparisons. For that matter, the test passes for ref with it. Though someone more knowledgeable with perl+math should opine here. I don't know if NAN / INF are the only issues in this test wrt -ffast-math.