public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/103376] [12 Regression] wrong code at -Os and above on x86_64-linux-gnu since r12-5453-ga944b5dec3adb28e
Date: Thu, 25 Nov 2021 09:40:07 +0000	[thread overview]
Message-ID: <bug-103376-4-UQUnxdTc9K@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103376-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:531dae29a67e915a145d908bd2f46d22bc369c11

commit r12-5512-g531dae29a67e915a145d908bd2f46d22bc369c11
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Nov 25 10:38:33 2021 +0100

    bswap: Improve perform_symbolic_merge [PR103376]

    Thinking more about it, perhaps we could do more for BIT_XOR_EXPR.
    We could allow masked1 == masked2 case for it, but would need to
    do something different than the
      n->n = n1->n | n2->n;
    we do on all the bytes together.
    In particular, for masked1 == masked2 if masked1 != 0 (well, for 0
    both variants are the same) and masked1 != 0xff we would need to
    clear corresponding n->n byte instead of setting it to the input
    as x ^ x = 0 (but if we don't know what x and y are, the result is
    also don't know).  Now, for plus it is much harder, because not only
    for non-zero operands we don't know what the result is, but it can
    modify upper bytes as well.  So perhaps only if current's byte
    masked1 && masked2 set the resulting byte to 0xff (unknown) iff
    the byte above it is 0 and 0, and set that resulting byte to 0xff too.
    Also, even for | we could instead of return NULL just set the resulting
    byte to 0xff if it is different, perhaps it will be masked off later on.

    This patch just punts on plus if both corresponding bytes are non-zero,
    otherwise implements the above.

    2021-11-25  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/103376
            * gimple-ssa-store-merging.c (perform_symbolic_merge): For
            BIT_IOR_EXPR, if masked1 && masked2 && masked1 != masked2, don't
            punt, but set the corresponding result byte to MARKER_BYTE_UNKNOWN.
            For BIT_XOR_EXPR similarly and if masked1 == masked2 and the
            byte isn't MARKER_BYTE_UNKNOWN, set the corresponding result byte
to
            0.

            * gcc.dg/optimize-bswapsi-7.c: New test.

  parent reply	other threads:[~2021-11-25  9:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23  8:22 [Bug tree-optimization/103376] New: wrong code at -Os and above on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
2021-11-23  8:30 ` [Bug tree-optimization/103376] [12 Regression] wrong code at -Os and above on x86_64-linux-gnu since r12-5453-ga944b5dec3adb28e marxin at gcc dot gnu.org
2021-11-23 10:41 ` jakub at gcc dot gnu.org
2021-11-23 11:01 ` jakub at gcc dot gnu.org
2021-11-23 11:06 ` jakub at gcc dot gnu.org
2021-11-23 13:17 ` jakub at gcc dot gnu.org
2021-11-24  2:02 ` pinskia at gcc dot gnu.org
2021-11-24  2:03 ` pinskia at gcc dot gnu.org
2021-11-24  7:09 ` zhendong.su at inf dot ethz.ch
2021-11-24  8:55 ` cvs-commit at gcc dot gnu.org
2021-11-24  8:56 ` jakub at gcc dot gnu.org
2021-11-24 14:15 ` roger at nextmovesoftware dot com
2021-11-25  9:40 ` cvs-commit at gcc dot gnu.org [this message]
2022-04-09 19:23 ` 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-103376-4-UQUnxdTc9K@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).