summary refs log tree commit diff
path: root/soft-fp/fixunstfti.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2014-10-09 01:07:10 +0000
committerJoseph Myers <joseph@codesourcery.com>2014-10-09 01:07:10 +0000
commit0022e688d082761a1e15b19121303cafbdad33ec (patch)
treefeb146a250a010d44ebcabca982503ca095a28f8 /soft-fp/fixunstfti.c
parent73e28d9c885fdfed91e6d70c4aab7e8e801818e3 (diff)
downloadglibc-0022e688d082761a1e15b19121303cafbdad33ec.tar.gz
glibc-0022e688d082761a1e15b19121303cafbdad33ec.tar.xz
glibc-0022e688d082761a1e15b19121303cafbdad33ec.zip
soft-fp: Fix _FP_TO_INT latent bug in overflow handling.
This patch fixes a latent bug in _FP_TO_INT regarding handling of
arguments with maximum exponent (infinities and NaNs).  If the maximum
exponent is below that calculated as an overflow threshold, such
values would incorrectly be treated as normal values for the purposes
of the conversion.  This could not occur for any of the conversions
actually occurring in glibc, libgcc or the Linux kernel (the maximum
exponent for float is, just, big enough to ensure overflow for
unsigned __int128), but would apply if soft-fp were used for IEEE
binary16.  Appropriate checks are inserted to ensure that the maximum
exponent is always treated as an overflowing exponent, and never as a
normal one.

Tested for powerpc-nofpu that the disassembly of installed shared
libraries is unchanged by this patch.

	* soft-fp/op-common.h (_FP_TO_INT): Ensure maximum exponent is
	treated as invalid conversion, not as normal exponent.
Diffstat (limited to 'soft-fp/fixunstfti.c')
0 files changed, 0 insertions, 0 deletions