Thread View: gnu.utils.bug
1 messages
1 total messages
Started by Georg Feil
Fri, 01 Dec 1989 00:12
Bug fix for gas 1.34 atof
Author: Georg Feil
Date: Fri, 01 Dec 1989 00:12
Date: Fri, 01 Dec 1989 00:12
52 lines
2279 bytes
2279 bytes
Here is the fix for a bug in gas 1.34 that I reported several weeks ago
but was too lazy to go after. As I suspected at that time, it turned out to
be a nasty one (~ 6 hour bug hunt).
The problem involves the ascii to floating-point conversion routines
atof-generic.c and flonum-mult.c when given numbers with excess trailing
zeroes. Here is a test file that demonstrates the bug:
--------------------- bad.s --------------------
.data
.double 0r4.50359962737049600000e+15
------------------------------------------------
Here is a similar file that assembles correctly:
--------------------- good.s --------------------
.data
.double 0r4.503599627370496e+15
------------------------------------------------
Compare the binary output from assembling these two input files, and you
should find that it differs. Closer inspection will show loss of precision
in the 'bad.s' case.
There are two patches, as follows:
-------------------- diff old.flonum-mult.c flonum-mult.c -----------
146c146
< if (significant)
---
> if (significant || P < 0)
---------------------------------------------------------------------
------------------- diff old.atof-generic.c atof-generic.c ---------
270,271c270,271
< ) /* Number of destination littlenums. */
< + 2; /* + 2 :: guard bits :: excess precision */
---
> ); /* Number of destination littlenums. Should
> /* already include guard bits (2 littlenums) */
---------------------------------------------------------------------
Georg.
--
Georg Feil "The roof is leaking
ghfeil@white.toronto.edu and the wind is howling"
...if that doesn't work try one of:
{uunet,pyramid,watmath,utzoo}!utcsri!white!ghfeil
ghfeil%white.toronto.edu@relay.cs.net (ARPA)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads