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 middle-end/112581] [14 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu (generated code hangs) since r14-4661
Date: Fri, 17 Nov 2023 23:04:17 +0000	[thread overview]
Message-ID: <bug-112581-4-atd4VSr9yc@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112581-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
forwprop3 does:
```
  _12 = ~iftmp.7_30;
  h_40 = (unsigned int) _12;
...
  if (h_40 == 4294967295)
```

into:
```
  _75 = (unsigned int) iftmp.7_30;
  if (iftmp.7_30 == 0)
```

Which as far as I can tell is correct.

And then reassociate2 combines:
```
  <bb 18> [local count: 57431765]:
  if (iftmp.7_30 == 0)
    goto <bb 19>; [97.17%]
  else
    goto <bb 20>; [2.83%]

  <bb 19> [local count: 55807730]:
  if (i_27 != 0)
    goto <bb 20>; [100.00%]
  else
    goto <bb 17>; [0.00%]
```
into:
```
  <bb 18> [local count: 57431765]:
  _75 = iftmp.7_30 | i_27;
  _33 = _75 == 0;
  if (_33 != 0)
    goto <bb 17>; [97.17%]
  else
    goto <bb 19>; [2.83%]
```

or
```
if ((_30 == 0) & (i_27 == 0)) goto <17> else goto <19/20>
```
Which looks correct.
I don't see anything going wrong with the patch itself ...

  parent reply	other threads:[~2023-11-17 23:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-17  5:07 [Bug tree-optimization/112581] New: wrong code at -O2 and -O3 on x86_64-linux-gnu (generated code hangs) zhendong.su at inf dot ethz.ch
2023-11-17  5:13 ` [Bug middle-end/112581] " pinskia at gcc dot gnu.org
2023-11-17  7:15 ` [Bug middle-end/112581] [14 Regression] " rguenth at gcc dot gnu.org
2023-11-17  9:26 ` ubizjak at gmail dot com
2023-11-17 11:16 ` [Bug middle-end/112581] [14 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu (generated code hangs) since r14-4661 jakub at gcc dot gnu.org
2023-11-17 22:41 ` pinskia at gcc dot gnu.org
2023-11-17 23:04 ` pinskia at gcc dot gnu.org [this message]
2023-11-17 23:14 ` pinskia at gcc dot gnu.org
2023-11-17 23:18 ` pinskia at gcc dot gnu.org
2023-11-17 23:25 ` pinskia at gcc dot gnu.org
2023-11-18  4:09 ` [Bug middle-end/112581] [14 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu (generated code hangs) since r14-4661 due to reassoc not handling maybe_undefs pinskia at gcc dot gnu.org
2023-12-21 21:07 ` pinskia at gcc dot gnu.org
2023-12-23 18:36 ` pinskia at gcc dot gnu.org
2024-01-10 17:11 ` cvs-commit at gcc dot gnu.org
2024-01-10 17:11 ` 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-112581-4-atd4VSr9yc@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).