http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50724
--- Comment #9 from Ethan Tira-Thompson <ejtttje at gmail dot com> 2011-10-14 20:07:41 UTC --- Thanks, I think Michael hit the nail on the head for summarizing my intention, I'm satisfied to file this as a feature request (although personally I'd still call it a bug ;)) For reference regarding the test case, I agree with your point that 0.f/0 needn't be a reliable NaN generator under -ffast-math. The original source was actually using std::numeric_limits<float>::quiet_NaN() and/or signaling_NaN(), but I switched to 0.f/0 in order to test under C (not-++) and forgot to switch back. So yeah, considering numeric_limits still returns the NaN bit patterns regardless of -ff-m-o, it's unbalanced that isnan is prevented from detecting them. Regardless, disabling classification routines is going beyond the scope of "math" and "arithmetic" as per the name of the flag and its documentation. (For those oversimplifying -ff-m-o as "No NaNs", perhaps you would like to add a new -fno-nans or perhaps -fno-quiet-nans flag if that is what you really want -ffinite-math-only to mean...) In the three linked bug reports, the first is basically a "don't do that" without discussion, the second specifically complains about the lack of discussion, and the third is redirected toward fixing an issue in -mno-ieee without resolving the -ffinite-math-only aspect.