[Gmp-commit] /var/hg/gmp-6.1: Merge changes from mainline.

mercurial at gmplib.org mercurial at gmplib.org
Mon Feb 19 13:43:26 UTC 2018


details:   /var/hg/gmp-6.1/rev/aad821ef06cb
changeset: 16974:aad821ef06cb
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Mon Feb 19 14:43:00 2018 +0100
description:
Merge changes from mainline.

diffstat:

 ChangeLog            |  22 ++++++++++++++++++++++
 acinclude.m4         |   8 ++++----
 longlong.h           |   3 ---
 printf/snprntffuns.c |  10 ++++------
 tune/Makefile.am     |   3 +++
 5 files changed, 33 insertions(+), 13 deletions(-)

diffs (135 lines):

diff -r bce8e07b51a6 -r aad821ef06cb ChangeLog
--- a/ChangeLog	Sat Dec 16 22:32:27 2017 +0100
+++ b/ChangeLog	Mon Feb 19 14:43:00 2018 +0100
@@ -1,3 +1,25 @@
+2018-02-18 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* tune/Makefile.am: Disallow parallel make (thanks Vincent Lefevre).
+
+2018-02-08 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* printf/snprntffuns.c: Report -1 as an error.
+	* acinclude.m4 (GMP_FUNC_VSNPRINTF): Refuse -1 as return value.
+
+2018-02-01  Marc Glisse  <marc.glisse at inria.fr>
+
+	* longlong.h (i586): Remove assert.
+
+2018-01-30 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* printf/snprntffuns.c: Use size_t instead of int.
+
+2017-12-27  Niels Möller  <nisse at lysator.liu.se>
+
+	* longlong.h (arm32/arm64): Leave COUNT_LEADING_ZEROS_0 undefined,
+	since we use gcc's __builtin_clzl, which doesn't allow zero inputs.
+
 2017-12-16  Torbjörn Granlund  <tg at gmplib.org>
 
 	* mpn/x86_64/fastsse/com.asm: Adhere to DOS64 xmm callee-saves rules.
diff -r bce8e07b51a6 -r aad821ef06cb acinclude.m4
--- a/acinclude.m4	Sat Dec 16 22:32:27 2017 +0100
+++ b/acinclude.m4	Mon Feb 19 14:43:00 2018 +0100
@@ -63,7 +63,7 @@
 [[i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-* | viac3*-*-* | geode*-*-* | atom-*-*]])
 
 define(X86_64_PATTERN,
-[[athlon64-*-* | k8-*-* | k10-*-* | bobcat-*-* | jaguar*-*-* | bulldozer*-*-* | piledriver*-*-* | steamroller*-*-* | excavator*-*-* | pentium4-*-* | atom-*-* | silvermont-*-* | goldmont-*-* | core2-*-* | corei*-*-* | x86_64-*-* | nano-*-* | nehalem*-*-* | westmere*-*-* | sandybridge*-*-* | ivybridge*-*-* | haswell*-*-* | broadwell*-*-* | skylake*-*-* | kabylake*-*-*]])
+[[athlon64-*-* | k8-*-* | k10-*-* | bobcat-*-* | jaguar*-*-* | bulldozer*-*-* | piledriver*-*-* | steamroller*-*-* | excavator*-*-* | zen*-*-* | pentium4-*-* | atom-*-* | silvermont-*-* | goldmont-*-* | core2-*-* | corei*-*-* | x86_64-*-* | nano-*-* | nehalem*-*-* | westmere*-*-* | sandybridge*-*-* | ivybridge*-*-* | haswell*-*-* | broadwell*-*-* | skylake*-*-* | kabylake*-*-*]])
 
 dnl  GMP_FAT_SUFFIX(DSTVAR, DIRECTORY)
 dnl  ---------------------------------
@@ -741,7 +741,7 @@
   long i;
   for (i = 0; i < 88 + 1; i++)
     a[i] = ~0L;
-  r = malloc (10000 * sizeof (unsigned long));
+  r = calloc (10000, sizeof (unsigned long));
   r2 = r;
   for (i = 0; i < 528; i += 23)
     {
@@ -3729,11 +3729,11 @@
 
   ret = vsnprintf (buf, 4, fmt, ap);
 
-  if (strcmp (buf, "hel") != 0)
+  if (ret == -1 || strcmp (buf, "hel") != 0)
     return 1;
 
   /* allowed return values */
-  if (ret != -1 && ret != 3 && ret != 11)
+  if (ret != 3 && ret != 11)
     return 2;
 
   return 0;
diff -r bce8e07b51a6 -r aad821ef06cb longlong.h
--- a/longlong.h	Sat Dec 16 22:32:27 2017 +0100
+++ b/longlong.h	Mon Feb 19 14:43:00 2018 +0100
@@ -534,7 +534,6 @@
 #endif /* defined(__ARM_ARCH_2__) ... */
 #define count_leading_zeros(count, x)  count_leading_zeros_gcc_clz(count, x)
 #define count_trailing_zeros(count, x)  count_trailing_zeros_gcc_ctz(count, x)
-#define COUNT_LEADING_ZEROS_0 32
 #endif /* __arm__ */
 
 #if defined (__aarch64__) && W_TYPE_SIZE == 64
@@ -558,7 +557,6 @@
   } while (0)
 #define count_leading_zeros(count, x)  count_leading_zeros_gcc_clz(count, x)
 #define count_trailing_zeros(count, x)  count_trailing_zeros_gcc_ctz(count, x)
-#define COUNT_LEADING_ZEROS_0 64
 #endif /* __aarch64__ */
 
 #if defined (__clipper__) && W_TYPE_SIZE == 32
@@ -940,7 +938,6 @@
       double    d;							\
       unsigned  a[2];							\
     } __u;								\
-    ASSERT ((n) != 0);							\
     __u.d = (UWtype) (n);						\
     (c) = 0x3FF + 31 - (__u.a[1] >> 20);				\
   } while (0)
diff -r bce8e07b51a6 -r aad821ef06cb printf/snprntffuns.c
--- a/printf/snprntffuns.c	Sat Dec 16 22:32:27 2017 +0100
+++ b/printf/snprntffuns.c	Mon Feb 19 14:43:00 2018 +0100
@@ -63,7 +63,8 @@
 gmp_snprintf_format (struct gmp_snprintf_t *d, const char *fmt,
                      va_list orig_ap)
 {
-  int      ret, step, alloc, avail;
+  int      ret;
+  size_t   step, alloc, avail;
   va_list  ap;
   char     *p;
 
@@ -75,10 +76,7 @@
       va_copy (ap, orig_ap);
       ret = vsnprintf (d->buf, avail, fmt, ap);
       if (ret == -1)
-        {
-          ASSERT (strlen (d->buf) == avail-1);
-          ret = avail-1;
-        }
+        return ret;
 
       step = MIN (ret, avail-1);
       d->size -= step;
@@ -104,7 +102,7 @@
       ret = vsnprintf (p, alloc, fmt, ap);
       (*__gmp_free_func) (p, alloc);
     }
-  while (ret == alloc-1 || ret == -1);
+  while (ret == alloc-1);
 
   return ret;
 }
diff -r bce8e07b51a6 -r aad821ef06cb tune/Makefile.am
--- a/tune/Makefile.am	Sat Dec 16 22:32:27 2017 +0100
+++ b/tune/Makefile.am	Mon Feb 19 14:43:00 2018 +0100
@@ -179,3 +179,6 @@
 	echo "#include \"mpz/fac_ui.c\""             >>fac_ui.c
 
 include ../mpn/Makeasm.am
+
+.NOTPARALLEL:
+


More information about the gmp-commit mailing list