glibc/sysdeps
Joseph Myers c8235dda72 Avoid excess range overflowing results from cosh, sinh, lgamma (bug 18980).
Various i386 libm functions return values with excess range and
precision; Wilco Dijkstra's patches to make isfinite etc. expand
inline cause this pre-existing issue to result in test failures (when
e.g. a result that overflows float but not long double gets counted as
overflowing for some purposes but not others).

This patch addresses those cases arising from functions defined in C,
adding a math_narrow_eval macro that forces values to memory to
eliminate excess precision if FLT_EVAL_METHOD indicates this is
needed, and is a no-op otherwise.  I'll convert existing uses of
volatile and asm for this purpose to use the new macro later, once
i386 has clean test results again (which requires fixes for .S files
as well).

Tested for x86_64 and x86.  Committed.

	[BZ #18980]
	* sysdeps/generic/math_private.h: Include <float.h>.
	(math_narrow_eval): New macro.
	[FLT_EVAL_METHOD != 0] (excess_precision): Likewise.
	* sysdeps/ieee754/dbl-64/e_cosh.c (__ieee754_cosh): Use
	math_narrow_eval on overflowing return value.
	* sysdeps/ieee754/dbl-64/e_lgamma_r.c (__ieee754_lgamma_r):
	Likewise.
	* sysdeps/ieee754/dbl-64/e_sinh.c (__ieee754_sinh): Likewise.
	* sysdeps/ieee754/flt-32/e_coshf.c (__ieee754_coshf): Likewise.
	* sysdeps/ieee754/flt-32/e_lgammaf_r.c (__ieee754_lgammaf_r):
	Likewise.
	* sysdeps/ieee754/flt-32/e_sinhf.c (__ieee754_sinhf): Likewise.
2015-09-18 20:00:48 +00:00
..
aarch64
alpha
arm arm: setjmp/longjmp: fix PIC vs SHARED thinkos 2015-09-18 13:09:57 -04:00
generic Avoid excess range overflowing results from cosh, sinh, lgamma (bug 18980). 2015-09-18 20:00:48 +00:00
gnu
hppa
i386 Make scalbn set errno (bug 6803). 2015-09-16 21:11:00 +00:00
ia64
ieee754 Avoid excess range overflowing results from cosh, sinh, lgamma (bug 18980). 2015-09-18 20:00:48 +00:00
init_array
m68k Make scalbn set errno (bug 6803). 2015-09-16 21:11:00 +00:00
mach
microblaze
mips
nacl
nios2
nptl Use __libc_ptf_call in _longjmp_unwind 2015-09-18 12:22:47 -07:00
posix
powerpc
pthread
s390
sh
sparc Make scalbn set errno (bug 6803). 2015-09-16 21:11:00 +00:00
tile
unix Use __libc_ptf_call in _longjmp_unwind 2015-09-18 12:22:47 -07:00
wordsize-32
wordsize-64
x86
x86_64 Make scalbn set errno (bug 6803). 2015-09-16 21:11:00 +00:00