public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/110479] New: Unnecessary register move
@ 2023-06-29  8:03 tkoenig at gcc dot gnu.org
  2023-06-29 12:41 ` [Bug rtl-optimization/110479] " ubizjak at gmail dot com
  2023-06-29 15:21 ` tkoenig at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2023-06-29  8:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110479
           Summary: Unnecessary register move
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tkoenig at gcc dot gnu.org
  Target Milestone: ---

May be related to / a dup of PR110240.

The function

unsigned int bar(unsigned int a)
{
  return 1u << (((a >> 10) & 3) + 3);
}

is compiled, with a relatively recent trunk and -O3, to

bar:
.LFB12:
        .cfi_startproc
        shrl    $10, %edi
        movl    $1, %eax
        movl    %edi, %ecx
        andl    $3, %ecx
        addl    $3, %ecx
        sall    %cl, %eax
        ret

where the register move seems unnecessary.

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

end of thread, other threads:[~2023-06-29 15:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-29  8:03 [Bug rtl-optimization/110479] New: Unnecessary register move tkoenig at gcc dot gnu.org
2023-06-29 12:41 ` [Bug rtl-optimization/110479] " ubizjak at gmail dot com
2023-06-29 15:21 ` tkoenig at gcc dot gnu.org

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