Index: lib/msun/ld128/s_logl.c =================================================================== --- lib/msun/ld128/s_logl.c +++ lib/msun/ld128/s_logl.c @@ -29,6 +29,8 @@ #include __FBSDID("$FreeBSD$"); +#include + /** * Implementation of the natural logarithm of x for 128-bit format. * @@ -469,9 +471,11 @@ if (hx == 0 || hx >= 0x8000) { /* zero, negative or subnormal? */ if (((hx & 0x7fff) | lx | llx) == 0) RETURN1(rp, -1 / zero); /* log(+-0) = -Inf */ - if (hx != 0) + if (hx != 0) { + feraiseexcept(FE_INVALID); /* log(neg or NaN) = qNaN: */ RETURN1(rp, (x - x) / zero); + } x *= 0x1.0p113; /* subnormal; scale up x */ EXTRACT_LDBL128_WORDS(hx, lx, llx, x); k = -16383 - 113; @@ -581,6 +585,7 @@ if (ax == 0x3fff && (lx | llx) == 0) RETURNP(-1 / zero); /* log1p(-1) = -Inf */ /* log1p(x < 1, or x NaN) = qNaN: */ + feraiseexcept(FE_INVALID); RETURNP((x - x) / (x - x)); } if (ax <= 0x3f8d) { /* |x| < 2**-113 */