This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/51446] -fno-trapping-math generates NaN constant with different sign
- From: "lucier at math dot purdue.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 07 Dec 2011 21:07:09 +0000
- Subject: [Bug tree-optimization/51446] -fno-trapping-math generates NaN constant with different sign
- Auto-submitted: auto-generated
- References: <bug-51446-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51446
--- Comment #3 from lucier at math dot purdue.edu 2011-12-07 21:07:09 UTC ---
I've looked through the code in real.c a bit (and perhaps the component of this
bug report should be changed).
It appears that do_divide, when given 0.0/0.0, calls get_canonical_qnan with
sign=0 (line 816 in real.c), but divsd actually returns a qnan with sign bit =
1.
Similarly, do_add when given Inf - Inf, calls get_canonical_qnan with sign bit
= 0 (line 574 of real.c), while subsd returns a qnan with sign bit = 1.
It seems that the sign bit in this situation should be target-dependent if you
want the constants to match what the actual instructions will provide.