public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/95852] Failure to optimize __builtin_mul_overflow pattern
Date: Mon, 11 Jan 2021 09:36:37 +0000	[thread overview]
Message-ID: <bug-95852-4-nK5GRY5540@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-95852-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95852

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:a2106317cd6673e110b347c70f21e25fbb23379e

commit r11-6579-ga2106317cd6673e110b347c70f21e25fbb23379e
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Jan 11 10:32:07 2021 +0100

    widening_mul: Pattern recognize unsigned multiplication with overflow check
[PR95852]

    The following patch pattern recognizes some forms of multiplication
followed
    by overflow check through division by one of the operands compared to the
    other one, with optional removal of guarding non-zero check for that
operand
    if possible.  The patterns are replaced with effectively
    __builtin_mul_overflow or __builtin_mul_overflow_p.  The testcases cover 64
    different forms of that.

    2021-01-11  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/95852
            * tree-ssa-math-opts.c (maybe_optimize_guarding_check): New
function.
            (uaddsub_overflow_check_p): Renamed to ...
            (arith_overflow_check_p): ... this.  Handle also multiplication
            with overflow check.
            (match_uaddsub_overflow): Renamed to ...
            (match_arith_overflow): ... this.  Add cfg_changed argument. 
Handle
            also multiplication with overflow check.  Adjust function comment.
            (math_opts_dom_walker::after_dom_children): Adjust callers.  Call
            match_arith_overflow also for MULT_EXPR.

            * gcc.target/i386/pr95852-1.c: New test.
            * gcc.target/i386/pr95852-2.c: New test.

  parent reply	other threads:[~2021-01-11  9:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 21:50 [Bug tree-optimization/95852] New: " gabravier at gmail dot com
2021-01-07 19:26 ` [Bug tree-optimization/95852] " jakub at gcc dot gnu.org
2021-01-08 13:45 ` jakub at gcc dot gnu.org
2021-01-11  9:36 ` cvs-commit at gcc dot gnu.org [this message]
2021-01-11  9:36 ` cvs-commit at gcc dot gnu.org
2021-01-11  9:37 ` jakub at gcc dot gnu.org

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=bug-95852-4-nK5GRY5540@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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: link
Be 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).