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.)