This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libfortran/48511] Implement Steele-White algorithm for numeric output


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48511

--- Comment #9 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-04-27 18:36:12 UTC ---
I've been thinking about this issue now and then over the past few weeks, and
funnily enough, while I initially thought this would be a nice improvement,
I've subsequently come to the opposite conclusion, namely that this shouldn't
be done:

- The use case is limited to making G0, and potentially list formatted, output
more compact in some cases. So the benefit isn't that big, IMHO.

- Even if we can start off with David Gay's code instead of reimplementing from
scratch, it means importing and maintaining potentially several thousand lines
of very tricky code.

- Getting something wrong may not only mean that we get some conversion wrong
in the last bit, but as can be seen in the recent issues with PHP and Java,
careless usage of Gay's code might lead to an infinite loop.

- As Tobias mentioned, there was enough issues with adapting Gay's code for
libquadmath that it was replaced with code from glibc.

- OTOH, currently we make use of {quadmath_}snprintf and strto{f,,ld,flt128},
which seem to be competently implemented at least on the widely used targets
(that is, they provide correctly rounded behavior), and are widely used also
outside of gfortran. This should definitely not be underestimated.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]