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 c/110337] Wrong code at -O2/s on x86_64-linux-gnu
Date: Wed, 21 Jun 2023 22:51:45 +0000	[thread overview]
Message-ID: <bug-110337-4-HjHijdUI56@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110337-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 110252.
  if (i_9 >= 0)
    goto <bb 3>; [59.00%]
  else
    goto <bb 4>; [41.00%]
;;    succ:       3 [59.0% (guessed)]  count:633507680 (estimated locally)
(TRUE_VALUE,EXECUTABLE)
;;                4 [41.0% (guessed)]  count:440234144 (estimated locally)
(FALSE_VALUE,EXECUTABLE)

;;   basic block 3, loop depth 0, count 633507681 (estimated locally)
;;    prev block 2, next block 4, flags: (NEW, REACHABLE, VISITED)
;;    pred:       2 [59.0% (guessed)]  count:633507680 (estimated locally)
(TRUE_VALUE,EXECUTABLE)
  # RANGE [irange] int [0, 1] NONZERO 0x1
  iftmp.6_10 = i_9 >> 14;
;;    succ:       4 [always]  count:633507681 (estimated locally)
(FALLTHRU,EXECUTABLE)

;;   basic block 4, loop depth 0, count 1073741824 (estimated locally), maybe
hot
;;    prev block 3, next block 1, flags: (NEW, REACHABLE, VISITED)
;;    pred:       3 [always]  count:633507681 (estimated locally)
(FALLTHRU,EXECUTABLE)
;;                2 [41.0% (guessed)]  count:440234144 (estimated locally)
(FALSE_VALUE,EXECUTABLE)

        i_9 >= 0 ? iftmp.6_10 : 1
Matching expression match.pd:1990, gimple-match-5.cc:23
Matching expression match.pd:1990, gimple-match-5.cc:23
Applying pattern match.pd:5283, gimple-match-4.cc:870
Applying pattern match.pd:1378, gimple-match-3.cc:7714
Applying pattern match.pd:1885, gimple-match-9.cc:1391
Applying pattern match.pd:4745, gimple-match-2.cc:16250
Folded into the sequence:
_4 = i_9 >= 0;
_2 = (int) _4;
_8 = i_9 < 0;
_13 = (int) _8;
_14 = iftmp.6_10 | _13;


The problem is i_9 >> 14 is only [0,1] iff inside the condition.

*** This bug has been marked as a duplicate of bug 110252 ***

      reply	other threads:[~2023-06-21 22:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-21 14:42 [Bug c/110337] New: " shaohua.li at inf dot ethz.ch
2023-06-21 22:51 ` pinskia at gcc dot gnu.org [this message]

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-110337-4-HjHijdUI56@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).