This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: Avoid overflows from long double functions using __kernel_standard


On 03/28/2012 03:03 AM, Joseph S. Myers wrote:
Error handling for various libm functions involves the function
__kernel_standard that provides support for errno setting and
"matherr".

This function takes double arguments; matherr is defined that way.
This causes problems for long double functions when converting long
double arguments to double causes overflow although the original
function did not overflow.  This patch addresses that by adding a
variant __kernel_standard_l that wraps __kernel_standard and reduces
out-of-range arguments to DBL_MAX or DBL_MIN (or minus those values)
to avoid spurious exceptions.

Tested x86 and x86_64.  Cases where there were spurious or missing
exceptions unrelated to this particular cause had appropriate comments
put in the tests (pointing to existing or new bugs) and
OVERFLOW_EXCEPTION_OK used to allow overflow exceptions to vary from
the desired results, or where other exceptions were involved some
tests were disabled for long double.

Aurelien, this should make it particularly easy to provide testsuite
coverage for your bug 13705 fix: simply remove ",
OVERFLOW_EXCEPTION_OK" and the comment from the test with a comment
pointing to bug 13705.

(This is actually the next piece of attempting to sort out bug 369; I
found too many of the new tests I added for that bug were failing for
long double because of issues with using __kernel_standard, so it
seemed appropriate to fix those issues first.)

This is fine, thanks a lot!


Andreas
--
 Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126


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