y0l, y1l, and ynl, applied to -LDBL_MAX, raise a spurious OVERFLOW exception in addition to a correct INVALID exception; tested x86. Example testcase: #include <errno.h> #include <fenv.h> #include <math.h> #include <stdio.h> #include <float.h> volatile long double d = -LDBL_MAX; int main (void) { feclearexcept (FE_ALL_EXCEPT); errno = 0; volatile long double r = ynl (2, d); if (fetestexcept (FE_DIVBYZERO)) printf ("DIVBYZERO "); if (fetestexcept (FE_INEXACT)) printf ("INEXACT "); if (fetestexcept (FE_INVALID)) printf ("INVALID "); if (fetestexcept (FE_OVERFLOW)) printf ("OVERFLOW "); if (fetestexcept (FE_UNDERFLOW)) printf ("UNDERFLOW "); printf ("%.18Lg %m\n", r); return 0; }
Fixed by: commit 41bf21a1e72c907b1a065727c3b5da43821ca6b0 Author: Joseph Myers <joseph@codesourcery.com> Date: Wed Mar 28 09:32:12 2012 +0000 Avoid overflows from long double functions using __kernel_standard.