public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/110873] [14 Regression] Dead Code Elimination Regression at -O2 since r14-376-g47a76439911
Date: Thu, 03 Aug 2023 02:59:06 +0000	[thread overview]
Message-ID: <bug-110873-4-gNY2mwKlBq@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110873-4@http.gcc.gnu.org/bugzilla/>

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-08-03
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
GCC 13 had:
```
 Registering value_relation (h_29 == h_13) (bb10) at h_29 = PHI <h_13(9)>
   Loops range found for h_29: [irange] unsigned char [5, 5] NONZERO 0x5 and
calculated range :[irange] unsigned char [0, 5] NONZERO 0x7
Global Exported: h_29 = [irange] unsigned char [5, 5] NONZERO 0x5
Folding PHI node: h_29 = PHI <h_13(9)>
Queued PHI for removal.  Folds to: 5
Folding statement: if (h_29 <= 4)
gimple_simplified to if (0 != 0)
gimple_simplified to if (0 != 0)
Folded into: if (0 != 0)
``
While trunk does:
```
redicate evaluates to: DON'T KNOW
Not folded
 Registering value_relation (h_29 == h_13) (bb10) at h_29 = PHI <h_13(9)>
Global Exported: h_29 = [irange] unsigned char [0, 5] MASK 0xfe VALUE 0xe7
Folding PHI node: h_29 = PHI <h_13(9)>
No folding possible
Folding statement: if (h_29 <= 4)

Visiting conditional with predicate: if (h_29 <= 4)

With known ranges
        h_29: [irange] unsigned char [0, 5] MASK 0xfe VALUE 0xe7

Predicate evaluates to: DON'T KNOW
Simplified relational if (h_29 <= 4)
 into if (h_29 != 5)

Folded into: if (h_29 != 5)
```
Which totally misses that h_29 was just 5.

  parent reply	other threads:[~2023-08-03  2:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-02 12:34 [Bug tree-optimization/110873] New: " scherrer.sv at gmail dot com
2023-08-02 13:02 ` [Bug tree-optimization/110873] " rguenth at gcc dot gnu.org
2023-08-03  2:59 ` pinskia at gcc dot gnu.org [this message]
2023-08-03  3:00 ` pinskia at gcc dot gnu.org
2024-03-07 23:27 ` law at gcc dot gnu.org
2024-05-07  7:41 ` [Bug tree-optimization/110873] [14/15 " rguenth 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-110873-4-gNY2mwKlBq@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).