public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/114009] [11/12/13/14 Regression] Missed optimization: (!a) * a => 0 when a=(a/2)*2
Date: Tue, 05 Mar 2024 13:02:03 +0000	[thread overview]
Message-ID: <bug-114009-4-gkQDofBcPw@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114009-4@http.gcc.gnu.org/bugzilla/>

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Is the regression marker added for the
r11-2550-gca2b8c082c4f16919071c9f8de8db0b33b54c405 change:
        movl    %edi, %eax
-       xorl    %edx, %edx
+       movl    $0, %edx
        shrl    $31, %eax
        addl    %edi, %eax
+       addl    $1, %edi
        andl    $-2, %eax
-       sete    %dl
-       imull   %edx, %eax
+       cmpl    $2, %edi
+       cmova   %edx, %eax
        movl    %eax, w(%rip)
        ret
or for the r12-5392-g527e54a431473cc497204226a21f2831d2375e66 change:
-       movl    %edi, %eax
-       movl    $0, %edx
-       shrl    $31, %eax
-       addl    %edi, %eax
-       addl    $1, %edi
-       andl    $-2, %eax
-       cmpl    $2, %edi
-       cmova   %edx, %eax
+       leal    1(%rdi), %eax
+       movl    %edi, %edx
+       cmpl    $2, %eax
+       setbe   %al
+       shrl    $31, %edx
+       addl    %edi, %edx
+       movzbl  %al, %eax
+       sarl    %edx
+       imull   %edx, %eax
+       addl    %eax, %eax
or both?  I don't think we ever optimized this without -fwrapv to just 0.

  parent reply	other threads:[~2024-03-05 13:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20 10:16 [Bug tree-optimization/114009] New: " 652023330028 at smail dot nju.edu.cn
2024-02-20 23:50 ` [Bug tree-optimization/114009] " pinskia at gcc dot gnu.org
2024-02-20 23:56 ` [Bug tree-optimization/114009] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
2024-02-21  0:03 ` pinskia at gcc dot gnu.org
2024-02-22 10:21 ` rguenth at gcc dot gnu.org
2024-03-05 13:02 ` jakub at gcc dot gnu.org [this message]
2024-03-05 14:14 ` jakub at gcc dot gnu.org
2024-03-05 14:24 ` jakub at gcc dot gnu.org
2024-03-07  7:47 ` cvs-commit at gcc dot gnu.org
2024-03-15  9:45 ` jakub 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-114009-4-gkQDofBcPw@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).