This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix atan2 spurious exceptions (bug 11451)
On Mon, 19 Mar 2012, Andreas Jaeger wrote:
> On 03/19/2012 06:45 PM, Joseph S. Myers wrote:
> > Bug 11451 reports atan2 raising spurious overflow exceptions for large
> > input on x86_64. (It also raises spurious invalid exceptions for the
> > same input, not mentioned in that bug report.) The code already
> > scales the inputs if very small, and already has handling for the case
> > where the inputs are very different in magnitude; I propose this patch
> > adding scaling for large inputs.
>
> Unfortunately libm-test.inc does not check the overflow exception, just the
> values. So, the testsuite does not really cover the bug you're fixing and
> there's no good place to add it. What do you think of creating a new test case
> that tests the overflow and underflow case?
Testing overflow in libm-test.inc is on my todo list. It might be
reasonable to have an interim state where tests for overflow are enabled,
but existing tests with spurious overflow are marked as "overflow
permitted", and likewise tests with missing overflow exceptions, with
comments pointing to bugs in Bugzilla in each case, until all such cases
are fixed.
I think that's better than separate testcases.
(For underflow exceptions: the default in C is that spurious underflow
exceptions are permitted, so you'd mark some as requiring underflow and a
few others as not permitting it; "underflow permitted" would be the
default case. Likewise for inexact, except that most functions do not
require inexact exceptions at all. Those are probably harder to set up
than testing for overflow exceptions would be.)
The test does cover the invalid exception, which I also saw and which was
what required this fix in order to make the clog fix.
--
Joseph S. Myers
joseph@codesourcery.com