This is the mail archive of the 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]

RE: [PATCH] fortran/PR58113

On Wed, 25 Sep 2013 21:00:33, Tobias Burnus wrote:
> Bernd Edlinger wrote:
>> this test case fails very often, and the reason is not in GCC but
>> in a missing glibc rounding support for strtod.
>> This patch fixes the test case, to first determine if the
>> rounding support is available. This is often the case for real(16)
>> thru the libquadmath. So even in cases where the test case usually
>> fails it still tests something with this patch.
>> Ok for trunk?
> First, for Fortran patches, it helps if you CC fortran@ as otherwise the
> email might be missed.
> Your change doesn't really directly check whether strtod handles
> rounding but whether libgfortran (invoking strtod) supports up/down
> rounding.
> Hence, after your patch, one effectively checks - given that up/down
> rounding works (or at least produces different values) - that the
> nearest/zero/up/down give the correct result.
> As only few strtod implementations currently support rounding, it is
> probably the best approach. However, I think it merits a comment making
> clear what it now checked (and what isn't). Maybe something along my
> paragraph (but polished) - and removing the then obsoleted parts of the
> existing comment.
> Except for the comment update, the patch looks fine to me.

OK, I used some of your wordings to update the comment.

I assume it's OK now.

> Tobias
> PS: I wonder whether there is a good way to do rounded strtod without
> relying on the system's libc to handle it.

Apparently the real(16) aka libquadmath has an own implementation
for strtod, that handles all rounding stuff the right way.

Probably it should be possible to locate that code and rework it for the
other possible real precisions, that currently rely on glibc's strtod.

However I will likely not have time for that :(


Attachment: changelog-round4.txt
Description: Text document

Attachment: patch-round4.diff
Description: Binary data

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