diff options
author | Joseph Myers <joseph@codesourcery.com> | 2015-10-01 17:15:54 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2015-10-01 17:15:54 +0000 |
commit | 4b84e2471b5f0c9197073395eb77843c6f23e790 (patch) | |
tree | 46351643320a86d5bfcdd04a89175e5934ecb65c /stdlib/cxa_finalize.c | |
parent | e27fcd027cbdc2f13bf440177c0434eb9ec3dd28 (diff) | |
download | glibc-4b84e2471b5f0c9197073395eb77843c6f23e790.tar.gz glibc-4b84e2471b5f0c9197073395eb77843c6f23e790.tar.xz glibc-4b84e2471b5f0c9197073395eb77843c6f23e790.zip |
Fix ldbl-128 / ldbl-128ibm lgamma overflow handling (bug 16347, bug 19046).
The ldbl-128 / ldbl-128ibm implementation of lgamma has problems with its handling of large arguments. It has an overflow threshold that is correct only for ldbl-128, despite being used for both types - with diagnostic control macros as a temporary measure to disable warnings about that constant overflowing for ldbl-128ibm - and it has a calculation that's roughly x * log(x) - x, resulting in overflows for arguments that are roughly at most a factor 1/log(threshold) below the overflow threshold. This patch fixes both issues, using an overflow threshold appropriate for the type in question and adding another case for large arguments that avoids the possible intermediate overflow. Tested for x86_64, x86, mips64 and powerpc. [BZ #16347] [BZ #19046] * sysdeps/ieee754/ldbl-128/e_lgammal_r.c: Do not include <libc-internal.h>. (MAXLGM): Do not use diagnostic control macros. [LDBL_MANT_DIG == 106] (MAXLGM): Change value to overflow threshold for ldbl-128ibm. (__ieee754_lgammal_r): For large arguments, multiply by log - 1 instead of multiplying by log then subtracting. * math/auto-libm-test-in: Add more tests of lgamma. * math/auto-libm-test-out: Regenerated.
Diffstat (limited to 'stdlib/cxa_finalize.c')
0 files changed, 0 insertions, 0 deletions