aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2016-11-03 12:52:19 +0000
committerBernd Edlinger <edlinger@gcc.gnu.org>2016-11-03 12:52:19 +0000
commit5de3e2d862e02f7b0c8efe8fbec2c15592302ba9 (patch)
treebbb121d397d87880f925bad35ace530d7cf2d7fd /libgcc
parent4098e9b907f82950130ed6820be9236727be7371 (diff)
downloadgcc-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')
-rw-r--r--libgcc/ChangeLog6
-rw-r--r--libgcc/libgcc2.c5
2 files changed, 11 insertions, 0 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index e2e5327..e81444c 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,9 @@
+2016-11-03 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ PR libgcc/78067
+ * libgcc2.c (__floatdisf, __floatdidf): Avoid undefined results from
+ count_leading_zeros.
+
2016-11-02 Uros Bizjak <ubizjak@gmail.com>
* Makefile.in (LIB2_DIVMOD_FUNCS): Add _divmoddi4.
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. */