This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/80692] _Decimal64 -0 != 0 unless optimization is turned off
- From: "segher at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 17 May 2017 21:57:55 +0000
- Subject: [Bug middle-end/80692] _Decimal64 -0 != 0 unless optimization is turned off
- Auto-submitted: auto-generated
- References: <bug-80692-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80692
--- Comment #3 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Author: segher
Date: Wed May 17 21:57:23 2017
New Revision: 248174
URL: https://gcc.gnu.org/viewcvs?rev=248174&root=gcc&view=rev
Log:
Fix comparison of decimal float zeroes (PR80692)
Decimal float negative zero should compare equal to positive zero.
Decimal float zeroes are encoded as value class "normal" (in real.c);
they need to be handled specially, but in this one case that does not
yet happen. This fixes it.
PR middle-end/80692
* real.c (do_compare): Give decimal_do_compare preference over
comparing just the signs.
gcc/testsuite/
PR middle-end/80692
* gcc.c-torture/execute/pr80692.c: New testcase.
Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr80692.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/real.c
trunk/gcc/testsuite/ChangeLog