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/99305] [11 Regression] range condition simplification after inlining
Date: Tue, 09 Mar 2021 18:13:59 +0000	[thread overview]
Message-ID: <bug-99305-4-ntfEiM07SR@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99305-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 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:b610c30453d8e4cc88693d85a5a100d089640be5

commit r11-7587-gb610c30453d8e4cc88693d85a5a100d089640be5
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Mar 9 19:13:11 2021 +0100

    phiopt: Fix up conditional_replacement [PR99305]

    Before my PR97690 changes, conditional_replacement would not set neg
    when the nonzero arg was boolean true.
    I've simplified the testing, so that it first finds the zero argument
    and then checks the other argument for all the handled cases
    (1, -1 and 1 << X, where the last case is what the patch added support
for).
    But, unfortunately I've placed the integer_all_onesp test first.
    For unsigned precision 1 types such as bool integer_all_onesp, integer_onep
    and integer_pow2p can all be true and the code set neg to true in that
case,
    which is undesirable.

    The following patch tests integer_pow2p first (which is trivially true
    for integer_onep too and tree_log2 in that case gives shift == 0)
    and only if that isn't the case, integer_all_onesp.

    2021-03-09  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/99305
            * tree-ssa-phiopt.c (conditional_replacement): Test integer_pow2p
            before integer_all_onesp instead of vice versa.

            * g++.dg/opt/pr99305.C: New test.

  parent reply	other threads:[~2021-03-09 18:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-27 14:23 [Bug rtl-optimization/99305] New: " nok.raven at gmail dot com
2021-03-01  9:22 ` [Bug rtl-optimization/99305] " rguenth at gcc dot gnu.org
2021-03-09 12:02 ` [Bug tree-optimization/99305] " jakub at gcc dot gnu.org
2021-03-09 12:20 ` jakub at gcc dot gnu.org
2021-03-09 12:20 ` jakub at gcc dot gnu.org
2021-03-09 12:41 ` jakub at gcc dot gnu.org
2021-03-09 18:13 ` cvs-commit at gcc dot gnu.org [this message]
2021-03-09 18:14 ` jakub at gcc dot gnu.org
2021-03-10 16:41 ` cvs-commit 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-99305-4-ntfEiM07SR@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).