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/105142] [12 Regression] Wrong code with -O2 since r12-2591
Date: Mon, 04 Apr 2022 09:25:17 +0000	[thread overview]
Message-ID: <bug-105142-4-c8FvTVae76@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105142-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
If so, that must be still during ifcombine though.
Because what I see is that we have effectively MIN_EXPR <a, MIN_EXPR <a, c> +
large_cst> until threadfull1, which decides to thread it based on the
a < c comparison, if a < c, then the result is just a and the addition is
optimized away as unused, otherwise effectively MIN_EXPR <c + large_cst, a>
is done.  I believe that is a correct transformation, because for undefined
overflow arithmetics (with no wrap around) a < c && a < c + large_cst is
equivalent.

  parent reply	other threads:[~2022-04-04  9:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-03 22:13 [Bug tree-optimization/105142] New: [12 Regression] Wrong code with -O2 vsevolod.livinskiy at gmail dot com
2022-04-03 22:20 ` [Bug tree-optimization/105142] [12 Regression] Wrong code with -O2 since r12-2591 jakub at gcc dot gnu.org
2022-04-03 22:33 ` jakub at gcc dot gnu.org
2022-04-04  7:27 ` rguenth at gcc dot gnu.org
2022-04-04  9:07 ` rguenth at gcc dot gnu.org
2022-04-04  9:25 ` jakub at gcc dot gnu.org [this message]
2022-04-04  9:26 ` jakub at gcc dot gnu.org
2022-04-04  9:28 ` rguenth at gcc dot gnu.org
2022-04-04  9:32 ` rguenth at gcc dot gnu.org
2022-04-04 10:11 ` rguenth at gcc dot gnu.org
2022-04-04 11:20 ` rguenth at gcc dot gnu.org
2022-04-04 12:43 ` rguenth at gcc dot gnu.org
2022-04-06  6:15 ` cvs-commit at gcc dot gnu.org
2022-04-06  6:17 ` rguenth at gcc dot gnu.org
2022-11-11 14:05 ` cvs-commit 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-105142-4-c8FvTVae76@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).