public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/100263] [11/12 Regression] Wrong removal of statement in copyprop3
Date: Mon, 26 Apr 2021 15:37:23 +0000	[thread overview]
Message-ID: <bug-100263-4-v68GO8CCs2@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100263-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Though, looking at the r11-39 optimized dump, I actually don't see anything
wrong.
The path taken in the testcase should be:
   <bb 2> [local count: 1073741824]:
   b.0_1 = b;
   if (b.0_1 != 2)
     goto <bb 3>; [96.34%]
...
   <bb 3> [local count: 1034442872]:
...
   <bb 4> [local count: 10321168952]:
   # b.12_44 = PHI <b.0_1(3), _32(42)>
   # c__lsm.20_50 = PHI <c__lsm.20_75(D)(3), c__lsm.20_51(42)>
   # c__lsm_flag.21_52 = PHI <0(3), c__lsm_flag.21_53(42)>
...
   if (a.1_7 != 0)
     goto <bb 5>; [50.00%]
   else
     goto <bb 19>; [50.00%]
...
   <bb 5> [local count: 5160584476]:
   if (h.4_5 != 0)
     goto <bb 9>; [89.00%]
   else
     goto <bb 42>; [11.00%]
...
   <bb 42> [local count: 9639533214]:
   # c__lsm.20_51 = PHI <c__lsm.20_50(41), 1(5)>
   # c__lsm_flag.21_53 = PHI <c__lsm_flag.21_52(41), 1(5)>
...
   _32 = b.12_44 + 254;
   if (_32 != 2)
     goto <bb 4>; [96.34%]
   else
     goto <bb 43>; [3.66%]

   <bb 43> [local count: 352806927]:
   if (c__lsm_flag.21_53 != 0)
     goto <bb 44>; [66.67%]
   else
     goto <bb 45>; [33.33%]

   <bb 44> [local count: 235204617]:
   MEM[(char *)&c + 107B] = c__lsm.20_51;
where bb will loop 126 times and then fall through to bb 43, but when bb 42 is
reached from bb 5 (should be always), then both SSA_NAMEs 51 and 53 are 1 and
so
the store of 1 should happen.

  parent reply	other threads:[~2021-04-26 15:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 10:49 [Bug tree-optimization/100263] New: " stefansf at linux dot ibm.com
2021-04-26 14:12 ` [Bug tree-optimization/100263] [11/12 Regression] " jakub at gcc dot gnu.org
2021-04-26 15:37 ` jakub at gcc dot gnu.org [this message]
2021-04-26 16:50 ` jakub at gcc dot gnu.org
2021-04-27  5:56 ` [Bug rtl-optimization/100263] [11/12 Regression] RTL optimizers miscompile loop stefansf at linux dot ibm.com
2021-04-27 10:27 ` stefansf at linux dot ibm.com
2021-04-28  8:43 ` stefansf at linux dot ibm.com
2021-04-28 10:03 ` jakub at gcc dot gnu.org
2021-04-28 10:41 ` ebotcazou at gcc dot gnu.org
2021-04-28 11:52 ` stefansf at linux dot ibm.com
2021-04-28 12:01 ` ebotcazou at gcc dot gnu.org
2021-04-28 14:20 ` stefansf at linux dot ibm.com
2021-05-05 15:01 ` cvs-commit at gcc dot gnu.org
2021-05-05 15:07 ` cvs-commit at gcc dot gnu.org
2021-05-05 15:10 ` cvs-commit at gcc dot gnu.org
2021-05-05 15:11 ` cvs-commit at gcc dot gnu.org
2021-05-05 15:13 ` cvs-commit at gcc dot gnu.org
2021-05-06 12:51 ` stefansf at linux dot ibm.com

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-100263-4-v68GO8CCs2@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).