]> Savannah Git Hosting - gnulib.git/commitdiff
intprops: speed up INT_MULTIPLY_WRAPV in GCC 9.3
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 19 Nov 2019 17:02:03 +0000 (09:02 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 19 Nov 2019 17:06:54 +0000 (09:06 -0800)
* lib/intprops.h (INT_MULTIPLY_WRAPV): If GCC 9.3 or later, do not
work around GCC bug 91450 as the bug should be fixed there.

ChangeLog
lib/intprops.h

index 7264231337070de0dcac57c37073428efe1cae36..f37a249b55bbc3f9a2ab0cc51cb31aa9f4bbe928 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-11-19  Paul Eggert  <eggert@cs.ucla.edu>
+
+       intprops: speed up INT_MULTIPLY_WRAPV in GCC 9.3
+       * lib/intprops.h (INT_MULTIPLY_WRAPV): If GCC 9.3 or later, do not
+       work around GCC bug 91450 as the bug should be fixed there.
+
 2019-11-18  Paul Eggert  <eggert@cs.ucla.edu>
 
        glob: get closer to glibc glob.c
index bc7e950a0eda45eb3386eea2f215bf46e0f0ca22..6a49c5ad4f534847c241747243db7c4f91c42d8c 100644 (file)
    _GL_INT_OP_WRAPV (a, b, r, -, _GL_INT_SUBTRACT_RANGE_OVERFLOW)
 #endif
 #if _GL_HAS_BUILTIN_MUL_OVERFLOW
-/* Work around GCC bug 91450.  */
+/* Work around GCC bug 91450 (fixed in GCC 9.3).  */
 # define INT_MULTIPLY_WRAPV(a, b, r) \
-   ((!_GL_SIGNED_TYPE_OR_EXPR (*(r)) && EXPR_SIGNED (a) && EXPR_SIGNED (b) \
+   ((! (9 < __GNUC__ + (3 <= __GNUC_MINOR__)) \
+     && !_GL_SIGNED_TYPE_OR_EXPR (*(r)) && EXPR_SIGNED (a) && EXPR_SIGNED (b) \
      && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1)) \
     ? ((void) __builtin_mul_overflow (a, b, r), 1) \
     : __builtin_mul_overflow (a, b, r))