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/114589] missed optimization: losing bool range information
Date: Thu, 04 Apr 2024 17:58:27 +0000	[thread overview]
Message-ID: <bug-114589-4-Up2J0GBW7K@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114589-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> Confirmed.
> 
> Why didn't sink1 push _10, _13, _12, and _11 past the conditional here ...
> If it did that I think it might have optimized correctly.

Because then _12 would be 1, _13 would be 4 and _10 would be come `_11 + 4` and
the loop induction variable would be going from _11 to `_11 + 4` then:
```
  # __for_begin_15 = PHI <__for_begin_8(6), _11(5)>
  # .MEM_16 = PHI <.MEM_7(6), .MEM_4(D)(5)>
  # VUSE <.MEM_16>
  i_6 = *__for_begin_15;
  # .MEM_7 = VDEF <.MEM_16>
  # USE = nonlocal escaped 
  # CLB = nonlocal escaped 
  _Z1fiD.2782 (i_6);
  # PT = nonlocal 
  __for_begin_8 = __for_begin_15 + 4;
  if (__for_begin_8 != _10)
    goto <bb 6>; [89.00%]
  else
    goto <bb 10>; [11.00%]
```

And we could figure out this loop is only gone through once only.

  parent reply	other threads:[~2024-04-04 17:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-04 17:28 [Bug c++/114589] New: " barry.revzin at gmail dot com
2024-04-04 17:47 ` [Bug tree-optimization/114589] " pinskia at gcc dot gnu.org
2024-04-04 17:58 ` pinskia at gcc dot gnu.org [this message]
2024-04-05  7:52 ` rguenth at gcc dot gnu.org
2024-04-05  9:39 ` [Bug tree-optimization/114589] missed optimization: losing bool range information, missed sinking rguenth at gcc dot gnu.org
2024-05-15  9:37 ` rguenth at gcc dot gnu.org
2024-05-15 11:32 ` rguenth at gcc dot gnu.org
2024-05-15 16:13 ` cvs-commit at gcc dot gnu.org
2024-05-15 16:14 ` 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-114589-4-Up2J0GBW7K@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).