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/110176] wrong code at -Os and above on x86_64-linux-gnu
Date: Thu, 08 Jun 2023 21:43:24 +0000	[thread overview]
Message-ID: <bug-110176-4-jd0VeTeYDR@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110176-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fre turns:
  b.2_4 = b;
  _5 = b.2_4 == 0;
  _6 = (int) _5;
  _7 = _6 <= i_19;
  _8 = (int) _7;
  b = _8;

Into:
  b.2_4 = b;
  _5 = b.2_4 == 0;
  _6 = (int) _5;
  b = 1;

Which is wrong as _6 <= -1 is always 0.

(simplify
(cmp (convert@0 @00) (convert?@1 @10))

...

tree min = lower_bound_in_type (TREE_TYPE (@10), TREE_TYPE (@00));
tree max = upper_bound_in_type (TREE_TYPE (@10), TREE_TYPE (@00));
bool above = integer_nonzerop (const_binop (LT_EXPR, type, max, @10));
bool below = integer_nonzerop (const_binop (LT_EXPR, type, @10, min));
...
(if (above || below)
...
{ constant_boolean_node (above ? true : false, type); }

  reply	other threads:[~2023-06-08 21:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08 14:44 [Bug tree-optimization/110176] New: " zhendong.su at inf dot ethz.ch
2023-06-08 21:43 ` pinskia at gcc dot gnu.org [this message]
2023-06-08 21:50 ` [Bug tree-optimization/110176] " pinskia at gcc dot gnu.org
2023-06-08 21:52 ` [Bug tree-optimization/110176] [10/11/12/13/14 Regression] " pinskia at gcc dot gnu.org
2023-06-08 22:10 ` pinskia at gcc dot gnu.org
2023-06-09  7:11 ` rguenth at gcc dot gnu.org
2023-07-07 10:45 ` [Bug tree-optimization/110176] [11/12/13/14 " rguenth at gcc dot gnu.org
2024-01-04 12:31 ` [Bug tree-optimization/110176] [11/12/13/14 Regression] wrong code at -Os and above on x86_64-linux-gnu since r11-2446 jakub at gcc dot gnu.org
2024-01-04 17:17 ` pinskia at gcc dot gnu.org
2024-01-08  9:37 ` rguenth at gcc dot gnu.org
2024-01-31 13:44 ` rguenth at gcc dot gnu.org
2024-01-31 14:47 ` cvs-commit at gcc dot gnu.org
2024-01-31 14:49 ` [Bug tree-optimization/110176] [11/12/13 " rguenth at gcc dot gnu.org
2024-02-06 13:20 ` cvs-commit at gcc dot gnu.org
2024-05-17 11:12 ` [Bug tree-optimization/110176] [11/12 " 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-110176-4-jd0VeTeYDR@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).