bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] * lib/intprops.h (INT_MULTIPLY_WRAPV): Simplify gcc -E output.


From: Paul Eggert
Subject: [PATCH] * lib/intprops.h (INT_MULTIPLY_WRAPV): Simplify gcc -E output.
Date: Tue, 19 Nov 2019 09:45:21 -0800

---
 lib/intprops.h | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/lib/intprops.h b/lib/intprops.h
index 6a49c5ad4..d0c2d706d 100644
--- a/lib/intprops.h
+++ b/lib/intprops.h
@@ -373,13 +373,16 @@
    _GL_INT_OP_WRAPV (a, b, r, -, _GL_INT_SUBTRACT_RANGE_OVERFLOW)
 #endif
 #if _GL_HAS_BUILTIN_MUL_OVERFLOW
-/* Work around GCC bug 91450 (fixed in GCC 9.3).  */
-# define INT_MULTIPLY_WRAPV(a, b, r) \
-   ((! (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))
+# if 9 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#  define INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r)
+# else
+   /* Work around GCC bug 91450.  */
+#  define INT_MULTIPLY_WRAPV(a, b, r) \
+    ((!_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))
+# endif
 #else
 # define INT_MULTIPLY_WRAPV(a, b, r) \
    _GL_INT_OP_WRAPV (a, b, r, *, _GL_INT_MULTIPLY_RANGE_OVERFLOW)
-- 
2.23.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]