diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2016-11-03 12:52:19 +0000 |
---|---|---|
committer | Bernd Edlinger <edlinger@gcc.gnu.org> | 2016-11-03 12:52:19 +0000 |
commit | 5de3e2d862e02f7b0c8efe8fbec2c15592302ba9 (patch) | |
tree | bbb121d397d87880f925bad35ace530d7cf2d7fd /libgcc/libgcc2.c | |
parent | 4098e9b907f82950130ed6820be9236727be7371 (diff) | |
download | gcc-5de3e2d862e02f7b0c8efe8fbec2c15592302ba9.zip gcc-5de3e2d862e02f7b0c8efe8fbec2c15592302ba9.tar.gz gcc-5de3e2d862e02f7b0c8efe8fbec2c15592302ba9.tar.bz2 |
re PR libgcc/78067 (libgcc2 calls count_leading_zero with 0)
2016-11-03 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR libgcc/78067
* libgcc2.c (__floatdisf, __floatdidf): Avoid undefined results from
count_leading_zeros.
testsuite:
2016-11-03 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR libgcc/78067
* gcc.dg/torture/fp-int-convert.h: Add more conversion tests.
From-SVN: r241817
Diffstat (limited to 'libgcc/libgcc2.c')
-rw-r--r-- | libgcc/libgcc2.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libgcc/libgcc2.c b/libgcc/libgcc2.c index 1d71fc4..97b9237 100644 --- a/libgcc/libgcc2.c +++ b/libgcc/libgcc2.c @@ -1674,6 +1674,11 @@ FUNC (DWtype u) hi = -(UWtype) hi; UWtype count, shift; +#if !defined (COUNT_LEADING_ZEROS_0) || COUNT_LEADING_ZEROS_0 != W_TYPE_SIZE + if (hi == 0) + count = W_TYPE_SIZE; + else +#endif count_leading_zeros (count, hi); /* No leading bits means u == minimum. */ |