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/114666] [14 Regression] Signed single bit comparison miscompile at -O2
Date: Tue, 09 Apr 2024 21:03:02 +0000	[thread overview]
Message-ID: <bug-114666-4-l0yltQanO4@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114666-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note the other pattern which uses logical_inverted_value where it depends on
the type does:

/* -(type)!A -> (type)A - 1.  */
(simplify
 (negate (convert?:s (logical_inverted_value:s @0)))
 (if (INTEGRAL_TYPE_P (type)
      && TREE_CODE (type) != BOOLEAN_TYPE
      && TYPE_PRECISION (type) > 1
      && TREE_CODE (@0) == SSA_NAME
      && ssa_name_has_boolean_range (@0))
  (plus (convert:type @0) { build_all_ones_cst (type); })))

But that is ok because of the check of >1 for precision. The other one dealing
with cond is a problem there.

  parent reply	other threads:[~2024-04-09 21:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-09 20:10 [Bug middle-end/114666] New: " patrick at rivosinc dot com
2024-04-09 20:11 ` [Bug middle-end/114666] " pinskia at gcc dot gnu.org
2024-04-09 20:16 ` pinskia at gcc dot gnu.org
2024-04-09 20:35 ` [Bug tree-optimization/114666] " pinskia at gcc dot gnu.org
2024-04-09 20:49 ` pinskia at gcc dot gnu.org
2024-04-09 21:03 ` pinskia at gcc dot gnu.org [this message]
2024-04-09 21:11 ` pinskia at gcc dot gnu.org
2024-04-09 22:58 ` pinskia at gcc dot gnu.org
2024-04-10 22:04 ` pinskia at gcc dot gnu.org
2024-04-11  1:10 ` pinskia at gcc dot gnu.org
2024-04-12 17:57 ` cvs-commit at gcc dot gnu.org
2024-04-12 17:57 ` 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-114666-4-l0yltQanO4@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).