This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] PowerPC: Fix for strtold overflow handling (bz14551)


I messed up the threads in my last email and the message ended up being
too confusing. This patch is intended to fix the bz14551
http://sourceware.org/bugzilla/show_bug.cgi?id=14551 and it fixes
the errors that 'tst-strtod-overflow' triggers with IBM long double.

Tested in PPC32 and PPC64.


2012-09-11  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>

	[BZ #14551]
	sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c: (__mpn_construct_long_double):
	Fix the overflow long double generation.


---
 sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c b/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
index b49ad96..53528d1 100644
--- a/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
@@ -134,7 +134,7 @@ __mpn_construct_long_double (mp_srcptr frac_ptr, int expt, int sign)
 	  lo = lo << lzcount;
 	  exponent2 = exponent2 - lzcount;
 	}
-      if (exponent2 > 0)
+      if (exponent2 > 0 && u.ieee.exponent < 0x7FF)
 	u.ieee.exponent2 = exponent2;
       else
 	lo >>= 1 - exponent2;

-- 
Adhemerval Zanella Netto
  Software Engineer
  Linux Technology Center Brazil
  Toolchain / GLIBC on Power Architecture
  azanella@linux.vnet.ibm.com / azanella@br.ibm.com
  +55 61 8642-9890


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]