public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Paul Eggert <eggert@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc] Sync intprops.h from Gnulib Date: Wed, 5 Aug 2020 05:59:04 +0000 (GMT) [thread overview] Message-ID: <20200805055904.0E0083844046@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7279f0a282283db04352e247c3bdb39ee03d10f6 commit 7279f0a282283db04352e247c3bdb39ee03d10f6 Author: Paul Eggert <eggert@cs.ucla.edu> Date: Tue Aug 4 22:58:58 2020 -0700 Sync intprops.h from Gnulib * include/intprops.h: Sync from Gnulib. This improves performance of INT_MULTIPLY_WRAPV on recent GCC, which affects glibc only in the support library. Diff: --- include/intprops.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/include/intprops.h b/include/intprops.h index 0c379a8c5b..6de65b067d 100644 --- a/include/intprops.h +++ b/include/intprops.h @@ -373,12 +373,17 @@ _GL_INT_OP_WRAPV (a, b, r, -, _GL_INT_SUBTRACT_RANGE_OVERFLOW) #endif #if _GL_HAS_BUILTIN_MUL_OVERFLOW -/* 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)) +# if (9 < __GNUC__ + (3 <= __GNUC_MINOR__) \ + || (__GNUC__ == 8 && 4 <= __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)
reply other threads:[~2020-08-05 5:59 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200805055904.0E0083844046@sourceware.org \ --to=eggert@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).