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/108166] [12/13 Regression] Wrong code with -O2 since r12-8078-ga42aa68bf1ad745a
Date: Thu, 22 Dec 2022 11:53:28 +0000	[thread overview]
Message-ID: <bug-108166-4-bugsXDZh4G@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108166-4@http.gcc.gnu.org/bugzilla/>

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

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

commit r13-4845-g5c17adfb5d08e34da7a7f234dfc2ed1f0aaadaa9
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Dec 22 12:52:48 2022 +0100

    phiopt: Drop SSA_NAME_RANGE_INFO in maybe equal case [PR108166]

    The following place in value_replacement is after proving that
    x == cst1 ? cst2 : x
    phi result is only used in a comparison with constant which doesn't
    care if it compares cst1 or cst2 and replaces it with x.
    The testcase is miscompiled because we have after the replacement
    incorrect range info for the phi result, we would need to
    effectively union the phi result range with cst1 (oarg in the code)
    because previously that constant might be missing in the range, but
    newly it can appear (we've just verified that the single use stmt
    of the phi result doesn't care about that value in particular).

    The following patch just resets the info, bootstrapped/regtested
    on x86_64-linux and i686-linux, ok for trunk?

    Aldy/Andrew, how would one instead union the SSA_NAME_RANGE_INFO
    with some INTEGER_CST and store it back into SSA_NAME_RANGE_INFO
    (including adjusting non-zero bits and the like)?

    2022-12-22  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/108166
            * tree-ssa-phiopt.cc (value_replacement): For the maybe_equal_p
            case turned into equal_p reset SSA_NAME_RANGE_INFO of phi result.

            * g++.dg/torture/pr108166.C: New test.

  parent reply	other threads:[~2022-12-22 11:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-18 19:46 [Bug tree-optimization/108166] New: [12/13 Regression] Wrong code with -O2 vsevolod.livinskiy at gmail dot com
2022-12-18 21:08 ` [Bug tree-optimization/108166] " pinskia at gcc dot gnu.org
2022-12-19  8:17 ` rguenth at gcc dot gnu.org
2022-12-19  8:34 ` [Bug tree-optimization/108166] [12/13 Regression] Wrong code with -O2 since r12-8078-ga42aa68bf1ad745a marxin at gcc dot gnu.org
2022-12-19 13:13 ` jakub at gcc dot gnu.org
2022-12-21 12:52 ` jakub at gcc dot gnu.org
2022-12-21 13:12 ` rguenth at gcc dot gnu.org
2022-12-21 13:14 ` rguenth at gcc dot gnu.org
2022-12-21 13:35 ` jakub at gcc dot gnu.org
2022-12-22 11:53 ` cvs-commit at gcc dot gnu.org [this message]
2022-12-22 11:55 ` [Bug tree-optimization/108166] [12 " jakub at gcc dot gnu.org
2023-02-10 17:45 ` cvs-commit at gcc dot gnu.org
2023-02-10 17:59 ` jakub at gcc dot gnu.org
2024-02-01 22:16 ` pinskia 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-108166-4-bugsXDZh4G@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).