This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/50724] isnan broken by -ffinite-math-only in g++
- From: "ejtttje at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 14 Oct 2011 22:07:44 +0000
- Subject: [Bug middle-end/50724] isnan broken by -ffinite-math-only in g++
- Auto-submitted: auto-generated
- References: <bug-50724-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50724
--- Comment #11 from Ethan Tira-Thompson <ejtttje at gmail dot com> 2011-10-14 22:07:44 UTC ---
Marc: is this code perusable? I'm curious because I expect either the
calculations may generate NaN or not at all. If they might and you even have
test cases to handle it, then I'm surprised you would ever want to support
running with -ff-m-o. Conversely if you knew the code doesn't generate the
nonfinite values, then you don't need the classifications in the first
place...?
I'm guessing (and apologies if this is inaccurate) that this might boil down to
saying that you want to interpret an end user setting -ff-m-o as an opportunity
to skip validating their input or skip doing assertions during its processing,
which could be a reasonable thing to do, but that's a choice I'd rather leave
to individual developers, e.g. can also wrap code with #if
__FINITE_MATH_ONLY__==0 or such...
Or in other words, it's only a missed optimization if you wind up with
classification calls, whereas it's a full-fledged execution error when NaN gets
past validation.