[Gmp-commit] /var/hg/gmp: Backed out changeset dd654535fbcc

mercurial at gmplib.org mercurial at gmplib.org
Sun Apr 26 21:16:45 UTC 2020


details:   /var/hg/gmp/rev/e5081fd9370f
changeset: 18069:e5081fd9370f
user:      Niels M?ller <nisse at lysator.liu.se>
date:      Sun Apr 26 23:16:03 2020 +0200
description:
Backed out changeset dd654535fbcc

It appears to break coverage analysis.

diffstat:

 mini-gmp/ChangeLog  |   9 ---------
 mini-gmp/mini-gmp.c |  22 +++++++++++-----------
 2 files changed, 11 insertions(+), 20 deletions(-)

diffs (102 lines):

diff -r dd654535fbcc -r e5081fd9370f mini-gmp/ChangeLog
--- a/mini-gmp/ChangeLog	Sun Apr 26 19:49:19 2020 +0200
+++ b/mini-gmp/ChangeLog	Sun Apr 26 23:16:03 2020 +0200
@@ -1,12 +1,3 @@
-2020-04-26  Niels Möller  <nisse at lysator.liu.se>
-
-	* mini-gmp.c (gmp_clz): Make LOCAL_SHIFT_BITS unsigned, to avoid
-	signed/unsigned comparison. Also add a prefix to the name, since
-	this is a macro. Similar change to other LOCAL_* variables for
-	consistency. That these variables are used at all is a workaround
-	to avoid unhelpful compiler warnings, see
-	https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94773.
-
 2020-04-20  Niels Möller  <nisse at lysator.liu.se>
 
 	* mini-gmp.c (mpz_fits_slong_p): Simplify, by using mpz_cmp_si.
diff -r dd654535fbcc -r e5081fd9370f mini-gmp/mini-gmp.c
--- a/mini-gmp/mini-gmp.c	Sun Apr 26 19:49:19 2020 +0200
+++ b/mini-gmp/mini-gmp.c	Sun Apr 26 23:16:03 2020 +0200
@@ -95,12 +95,12 @@
 #define gmp_clz(count, x) do {						\
     mp_limb_t __clz_x = (x);						\
     unsigned __clz_c = 0;						\
-    unsigned __clz_LOCAL_SHIFT_BITS = 8;				\
-    if (GMP_LIMB_BITS > __clz_LOCAL_SHIFT_BITS)				\
+    int LOCAL_SHIFT_BITS = 8;						\
+    if (GMP_LIMB_BITS > LOCAL_SHIFT_BITS)				\
       for (;								\
 	   (__clz_x & ((mp_limb_t) 0xff << (GMP_LIMB_BITS - 8))) == 0;	\
 	   __clz_c += 8)						\
-	{ __clz_x <<= __clz_LOCAL_SHIFT_BITS;	}			\
+	{ __clz_x <<= LOCAL_SHIFT_BITS;	}				\
     for (; (__clz_x & GMP_LIMB_HIGHBIT) == 0; __clz_c++)		\
       __clz_x <<= 1;							\
     (count) = __clz_c;							\
@@ -131,18 +131,18 @@
 
 #define gmp_umul_ppmm(w1, w0, u, v)					\
   do {									\
-    unsigned __LOCAL_GMP_LIMB_BITS = GMP_LIMB_BITS;			\
+    int LOCAL_GMP_LIMB_BITS = GMP_LIMB_BITS;				\
     if (sizeof(unsigned int) * CHAR_BIT >= 2 * GMP_LIMB_BITS)		\
       {									\
 	unsigned int __ww = (unsigned int) (u) * (v);			\
 	w0 = (mp_limb_t) __ww;						\
-	w1 = (mp_limb_t) (__ww >> __LOCAL_GMP_LIMB_BITS);		\
+	w1 = (mp_limb_t) (__ww >> LOCAL_GMP_LIMB_BITS);			\
       }									\
     else if (GMP_ULONG_BITS >= 2 * GMP_LIMB_BITS)			\
       {									\
 	unsigned long int __ww = (unsigned long int) (u) * (v);		\
 	w0 = (mp_limb_t) __ww;						\
-	w1 = (mp_limb_t) (__ww >> __LOCAL_GMP_LIMB_BITS);		\
+	w1 = (mp_limb_t) (__ww >> LOCAL_GMP_LIMB_BITS);			\
       }									\
     else {								\
       mp_limb_t __x0, __x1, __x2, __x3;					\
@@ -1488,7 +1488,7 @@
       MPZ_REALLOC (r, 1)[0] = x;
       if (GMP_LIMB_BITS < GMP_ULONG_BITS)
 	{
-	  unsigned LOCAL_GMP_LIMB_BITS = GMP_LIMB_BITS;
+	  int LOCAL_GMP_LIMB_BITS = GMP_LIMB_BITS;
 	  while (x >>= LOCAL_GMP_LIMB_BITS)
 	    {
 	      ++ r->_mp_size;
@@ -1606,7 +1606,7 @@
 {
   if (GMP_LIMB_BITS < GMP_ULONG_BITS)
     {
-      unsigned LOCAL_GMP_LIMB_BITS = GMP_LIMB_BITS;
+      int LOCAL_GMP_LIMB_BITS = GMP_LIMB_BITS;
       unsigned long r = 0;
       mp_size_t n = GMP_ABS (u->_mp_size);
       n = GMP_MIN (n, 1 + (mp_size_t) (GMP_ULONG_BITS - 1) / GMP_LIMB_BITS);
@@ -4003,7 +4003,7 @@
   unsigned c;
 
   /* Do 16 bits at a time, to avoid limb-sized constants. */
-  unsigned LOCAL_SHIFT_BITS = 16;
+  int LOCAL_SHIFT_BITS = 16;
   for (c = 0; x > 0;)
     {
       unsigned w = x - ((x >> 1) & 0x5555);
@@ -4525,7 +4525,7 @@
       if (!k)
 	{
 	  do {
-	    unsigned LOCAL_CHAR_BIT = CHAR_BIT;
+	    int LOCAL_CHAR_BIT = CHAR_BIT;
 	    k++; limb >>= LOCAL_CHAR_BIT;
 	  } while (limb != 0);
 	}
@@ -4569,7 +4569,7 @@
 		}
 	      else
 		{
-		  unsigned LOCAL_CHAR_BIT = CHAR_BIT;
+		  int LOCAL_CHAR_BIT = CHAR_BIT;
 		  if (bytes == 0)
 		    {
 		      if (i < un)


More information about the gmp-commit mailing list