Summary: | GCC incorrectly rounds hex floats | ||
---|---|---|---|
Product: | gcc | Reporter: | Neil Booth <neil> |
Component: | middle-end | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | gcc-bugs, jsm28 |
Priority: | P3 | Keywords: | diagnostic, wrong-code |
Version: | 4.1.0 | ||
Target Milestone: | 4.1.0 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | ||
Bug Depends on: | |||
Bug Blocks: | 16989 |
Description
Neil Booth
2005-05-23 15:01:11 UTC
Subject: Bug 21720 CVSROOT: /cvs/gcc Module name: gcc Changes by: jsm28@gcc.gnu.org 2005-07-29 01:24:39 Modified files: gcc : ChangeLog real.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.dg: hex-round-1.c Log message: PR c/21720 * real.c (real_from_string): Set last bit if there is a nonzero hex digit beyond GCC's internal precision. testsuite: * gcc.dg/hex-round-1.c: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9593&r2=2.9594 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/real.c.diff?cvsroot=gcc&r1=1.155&r2=1.156 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5847&r2=1.5848 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/hex-round-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1 Fixed. It turns out my patch actually fixed a similar problem with the code handling digits before the ".", and my testcase didn't have enough zeroes to show the problem on 64-bit hosts. Testing a patch to fix the problem properly (by making the same change to the code for digits after the "." and expanding the testcase). Subject: Bug 21720 CVSROOT: /cvs/gcc Module name: gcc Changes by: jsm28@gcc.gnu.org 2005-07-29 21:14:22 Modified files: gcc : ChangeLog real.c gcc/testsuite : ChangeLog gcc/testsuite/gcc.dg: hex-round-1.c Added files: gcc/testsuite/gcc.dg: hex-round-2.c Log message: PR c/21720 * real.c (real_from_string): Also set last bit if there is a nonzero hex digit beyond GCC's internal precision after ".". testsuite: * gcc.dg/hex-round-1.c: Test more cases. * gcc.dg/hex-round-2.c: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9606&r2=2.9607 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/real.c.diff?cvsroot=gcc&r1=1.156&r2=1.157 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5852&r2=1.5853 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/hex-round-2.c.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/hex-round-1.c.diff?cvsroot=gcc&r1=1.1&r2=1.2 Fixed. |