public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/95235] New: Failure to properly optimize out register use in bit-twiddling code
@ 2020-05-20  9:32 gabravier at gmail dot com
  2020-05-20  9:54 ` [Bug target/95235] " rguenth at gcc dot gnu.org
  2020-08-10 11:02 ` gabravier at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: gabravier at gmail dot com @ 2020-05-20  9:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95235
           Summary: Failure to properly optimize out register use in
                    bit-twiddling code
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

int f(int a, int b)
{
    return ((a & 1) != 0) != (b != 0);
}

With -O3, GCC outputs this :

f(int, int):
  test esi, esi
  setne al
  xor edi, eax
  mov eax, edi
  and eax, 1
  ret

GCC should be able of outputting this instead :

f(int, int):
  test esi, esi
  setne al
  xor eax, edi
  and eax, 1
  ret

But it does not do so.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug target/95235] Failure to properly optimize out register use in bit-twiddling code
  2020-05-20  9:32 [Bug target/95235] New: Failure to properly optimize out register use in bit-twiddling code gabravier at gmail dot com
@ 2020-05-20  9:54 ` rguenth at gcc dot gnu.org
  2020-08-10 11:02 ` gabravier at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-20  9:54 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64-*-* i?86-*-*

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
That's indeed odd.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug target/95235] Failure to properly optimize out register use in bit-twiddling code
  2020-05-20  9:32 [Bug target/95235] New: Failure to properly optimize out register use in bit-twiddling code gabravier at gmail dot com
  2020-05-20  9:54 ` [Bug target/95235] " rguenth at gcc dot gnu.org
@ 2020-08-10 11:02 ` gabravier at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: gabravier at gmail dot com @ 2020-08-10 11:02 UTC (permalink / raw)
  To: gcc-bugs

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

Gabriel Ravier <gabravier at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Gabriel Ravier <gabravier at gmail dot com> ---
Just rechecked and it looks like it was fixed at some point since I filed this
bug report.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-10 11:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-20  9:32 [Bug target/95235] New: Failure to properly optimize out register use in bit-twiddling code gabravier at gmail dot com
2020-05-20  9:54 ` [Bug target/95235] " rguenth at gcc dot gnu.org
2020-08-10 11:02 ` gabravier at gmail dot com

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).