glibc/sysdeps/ieee754
Joseph Myers 909f8e14db Fix ldbl-128ibm strtold overflow handling (bug 14551).
For ldbl-128ibm, if the result of strtold overflows in the final
conversion from MPN to IBM long double (because the exponent for a
106-bit IEEE result is 1023 but the high part would end up as
0x1p1024, which overflows), that conversion code fails to handle this
and produces an invalid long double value (high part infinite, low
part not zero) without raising exceptions or setting errno.  This
patch adds an explicit check for this case to ensure an appropriate
result is returned in a way that ensures the right exceptions are
raised, with errno set.

Tested for powerpc.

	[BZ #14551]
	* sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c: Include <errno.h>.
	(__mpn_construct_long_double): If high part overflows to infinity,
	set errno and recompute overflowed result of the correct sign.
	* sysdeps/ieee754/ldbl-128ibm/Makefile
	[$(subdir) = stdlib] (tests): Add tst-strtold-ldbl-128ibm.
	[$(subdir) = stdlib] ($(objpfx)tst-strtold-ldbl-128ibm): Depend on
	$(libm).
	* sysdeps/ieee754/ldbl-128ibm/tst-strtold-ldbl-128ibm.c: New file.
2015-11-13 12:03:46 +00:00
..
bits Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
dbl-64 Fix dbl-64 remainder sign of zero result (bug 19201). 2015-11-03 00:11:49 +00:00
flt-32 Make nextafter, nexttoward set errno (bug 6799). 2015-11-02 18:54:19 +00:00
ldbl-64-128 Make scalbn set errno (bug 6803). 2015-09-16 21:11:00 +00:00
ldbl-96 Make nextafter, nexttoward set errno (bug 6799). 2015-11-02 18:54:19 +00:00
ldbl-128 Make nextafter, nexttoward set errno (bug 6799). 2015-11-02 18:54:19 +00:00
ldbl-128ibm Fix ldbl-128ibm strtold overflow handling (bug 14551). 2015-11-13 12:03:46 +00:00
ldbl-opt Make nextafter, nexttoward set errno (bug 6799). 2015-11-02 18:54:19 +00:00
ieee754.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
k_standard.c Add comment to CSTR macro in k_standard.c. 2015-02-27 01:12:19 +00:00
k_standardf.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
k_standardl.c Fix spurious "inexact" exceptions from __kernel_standard_l (bug 18245, bug 18583). 2015-06-23 17:26:46 +00:00
Makefile Avoid -Wno-write-strings for k_standard.c. 2015-02-26 22:50:54 +00:00
s_lib_version.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
s_matherr.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_signgam.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00