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/103660] Sub-optimal code with relational operators
Date: Wed, 23 Aug 2023 04:45:30 +0000	[thread overview]
Message-ID: <bug-103660-4-u82wI1Ps0d@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103660-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #2)
> Actually:
> ```
> (for (op plus bit_ior bit_xor)
>  (simplify
>   (op (cond @0 @1 integer_zero_p)
>       (cond @2 @3 integer_zero_p))
>   (with { bool wascmp; }
>    (if (bitwise_inverted_equal_p (@0, @2, wascmp))
>     (cond @0 @1 @3)
>    )
>   )
>  )
> )
> ```
> Should fix this.
> 
> Well that replaces the pattern that was added in r13-4620-g4d9db4bdd458 and
> extends it to for plus and bit_xor.

Note I think the patterns added in that revision were incorrect:
+   (cond (cmp@0  @01 @02) @3 zerop)
+   (cond (icmp@4 @01 @02) @5 zerop))

allows for @1 and @2 (which by the way 01 and 02 is; just using base 8 rather
than base 10).

  parent reply	other threads:[~2023-08-23  4:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-11 13:14 [Bug c/103660] New: " david at westcontrol dot com
2021-12-12 23:58 ` [Bug tree-optimization/103660] " pinskia at gcc dot gnu.org
2023-08-23  3:45 ` pinskia at gcc dot gnu.org
2023-08-23  4:45 ` pinskia at gcc dot gnu.org [this message]
2023-08-23  4:49 ` 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-103660-4-u82wI1Ps0d@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).