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/103228] [9/10/11/12 Regression] missed optimization with |^ at the gimple level
Date: Mon, 15 Nov 2021 09:14:52 +0000	[thread overview]
Message-ID: <bug-103228-4-oYD79d8GVD@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103228-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #3)
> Possibly some STRIP_NOPS gone "missing" during fold-const.c -> match.pd move
> of some patterns.

Well match.pd has:
/* Try to fold (type) X op CST -> (type) (X op ((type-x) CST))
   when profitable.
   For bitwise binary operations apply operand conversions to the
   binary operation result instead of to the operands.  This allows
   to combine successive conversions and bitwise binary operations.
   We combine the above two cases by using a conditional convert.  */

Just the check for precision was < and not <= :
       && (/* That's a good idea if the conversion widens the operand, thus
              after hoisting the conversion the operation will be narrower.  */
           TYPE_PRECISION (TREE_TYPE (@0)) < TYPE_PRECISION (type)

I am going to test changing < to <=.
Note the atomic changed (PR 103194) might have some conflict with this.

  parent reply	other threads:[~2021-11-15  9:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-14  6:30 [Bug tree-optimization/103228] New: " pinskia at gcc dot gnu.org
2021-11-14  6:30 ` [Bug tree-optimization/103228] " pinskia at gcc dot gnu.org
2021-11-15  8:34 ` pinskia at gcc dot gnu.org
2021-11-15  8:37 ` pinskia at gcc dot gnu.org
2021-11-15  9:06 ` rguenth at gcc dot gnu.org
2021-11-15  9:07 ` rguenth at gcc dot gnu.org
2021-11-15  9:14 ` pinskia at gcc dot gnu.org [this message]
2021-11-16  3:32 ` cvs-commit at gcc dot gnu.org
2021-11-16  3:33 ` pinskia at gcc dot gnu.org
2021-11-16  3:36 ` pinskia at gcc dot gnu.org
2021-11-17 23:40 ` cvs-commit at gcc dot gnu.org
2021-11-17 23:40 ` 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-103228-4-oYD79d8GVD@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).