[Bug target/66663] gcc misses optimization emits useless test of (a & 31) with 32

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jul 27 00:01:53 GMT 2021


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
   Target Milestone|---                         |9.0
         Resolution|---                         |FIXED

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
GCC 9+ is able to produce:
foo(unsigned long long, int):
.LFB0:
        .cfi_startproc
        movl    4(%esp), %eax
        movl    12(%esp), %ecx
        movl    8(%esp), %edx
        shldl   %eax, %edx
        sall    %cl, %eax
        ret


More information about the Gcc-bugs mailing list