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 target/95798] [10/11 Regression] Initialization code --- suboptimal
Date: Thu, 25 Feb 2021 09:26:22 +0000	[thread overview]
Message-ID: <bug-95798-4-rnbzzYRvQR@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-95798-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #7 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:880682e7b2348d66f4089fa4af102b69eaaefbc2

commit r11-7384-g880682e7b2348d66f4089fa4af102b69eaaefbc2
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Feb 25 10:22:53 2021 +0100

    match.pd: Use :s for (T)(A) + CST -> (T)(A + CST) [PR95798]

    The r10-2806 change regressed following testcases, instead of doing
    int -> unsigned long sign-extension once and then add 8, 16, ... 56 to it
    for each of the memory access, it adds 8, 16, ... 56 in int mode and then
    sign extends each.  So that means:
    +       movq    $0, (%rsp,%rax,8)
    +       leal    1(%rdx), %eax
    +       cltq
    +       movq    $1, (%rsp,%rax,8)
    +       leal    2(%rdx), %eax
    +       cltq
    +       movq    $2, (%rsp,%rax,8)
    +       leal    3(%rdx), %eax
    +       cltq
    +       movq    $3, (%rsp,%rax,8)
    +       leal    4(%rdx), %eax
    +       cltq
    +       movq    $4, (%rsp,%rax,8)
    +       leal    5(%rdx), %eax
    +       cltq
    +       movq    $5, (%rsp,%rax,8)
    +       leal    6(%rdx), %eax
    +       addl    $7, %edx
    +       cltq
    +       movslq  %edx, %rdx
    +       movq    $6, (%rsp,%rax,8)
    +       movq    $7, (%rsp,%rdx,8)
    -       movq    $0, (%rsp,%rdx,8)
    -       movq    $1, 8(%rsp,%rdx,8)
    -       movq    $2, 16(%rsp,%rdx,8)
    -       movq    $3, 24(%rsp,%rdx,8)
    -       movq    $4, 32(%rsp,%rdx,8)
    -       movq    $5, 40(%rsp,%rdx,8)
    -       movq    $6, 48(%rsp,%rdx,8)
    -       movq    $7, 56(%rsp,%rdx,8)
    GCC 9 -> 10 change or:
    -       movq    $0, (%rsp,%rdx,8)
    -       movq    $1, 8(%rsp,%rdx,8)
    -       movq    $2, 16(%rsp,%rdx,8)
    -       movq    $3, 24(%rsp,%rdx,8)
    -       movq    $4, 32(%rsp,%rdx,8)
    -       movq    $5, 40(%rsp,%rdx,8)
    -       movq    $6, 48(%rsp,%rdx,8)
    -       movq    $7, 56(%rsp,%rdx,8)
    +       movq    $0, (%rsp,%rax,8)
    +       leal    1(%rdx), %eax
    +       movq    $1, (%rsp,%rax,8)
    +       leal    2(%rdx), %eax
    +       movq    $2, (%rsp,%rax,8)
    +       leal    3(%rdx), %eax
    +       movq    $3, (%rsp,%rax,8)
    +       leal    4(%rdx), %eax
    +       movq    $4, (%rsp,%rax,8)
    +       leal    5(%rdx), %eax
    +       movq    $5, (%rsp,%rax,8)
    +       leal    6(%rdx), %eax
    +       movq    $6, (%rsp,%rax,8)
    +       leal    7(%rdx), %eax
    +       movq    $7, (%rsp,%rax,8)
    change on the other test.  While for the former case of
    int there is due to signed integer overflow (unless -fwrapv)
    the possibility to undo it e.g. during expansion, for the unsigned
    case information is unfortunately lost.

    The following patch adds :s to the convert which restores these
    testcases but keeps the testcases the patch meant to improve as is.

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

            PR target/95798
            * match.pd ((T)(A) + CST -> (T)(A + CST)): Add :s to convert.

            * gcc.target/i386/pr95798-1.c: New test.
            * gcc.target/i386/pr95798-2.c: New test.

  parent reply	other threads:[~2021-02-25  9:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-21  7:16 [Bug target/95798] New: " zero at smallinteger dot com
2020-06-21 16:57 ` [Bug target/95798] " zero at smallinteger dot com
2020-06-22 10:42 ` [Bug target/95798] [10/11 Regression] " jakub at gcc dot gnu.org
2020-06-22 10:44 ` jakub at gcc dot gnu.org
2020-06-22 13:05 ` jakub at gcc dot gnu.org
2020-07-23  6:51 ` rguenth at gcc dot gnu.org
2020-10-12 12:54 ` rguenth at gcc dot gnu.org
2021-02-24 15:33 ` jakub at gcc dot gnu.org
2021-02-25  9:26 ` cvs-commit at gcc dot gnu.org [this message]
2021-02-25  9:27 ` [Bug target/95798] [10 " jakub at gcc dot gnu.org
2021-04-08 12:02 ` rguenth at gcc dot gnu.org
2022-06-28 10:41 ` jakub at gcc dot gnu.org
2023-07-07  8:55 ` rguenth 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-95798-4-rnbzzYRvQR@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).