* [PATCH] intprops: speed up INT_MULTIPLY_WRAPV in GCC 9.3
@ 2019-11-19 17:07 Paul Eggert
0 siblings, 0 replies; only message in thread
From: Paul Eggert @ 2019-11-19 17:07 UTC (permalink / raw)
To: bug-gnulib; +Cc: Paul Eggert
* 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 | 6 ++++++
lib/intprops.h | 5 +++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 726423133..f37a249b5 100644
--- 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
diff --git a/lib/intprops.h b/lib/intprops.h
index bc7e950a0..6a49c5ad4 100644
--- a/lib/intprops.h
+++ b/lib/intprops.h
@@ -373,9 +373,10 @@
_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))
--
2.23.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-11-19 17:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-19 17:07 [PATCH] intprops: speed up INT_MULTIPLY_WRAPV in GCC 9.3 Paul Eggert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).