[Bug tree-optimization/85516] [missed-optimization] gcc does not convert multiple compares against constants to a shift+bitmask test

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Jul 24 09:53:23 GMT 2021


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|middle-end                  |tree-optimization
           Severity|normal                      |enhancement

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note on the trunk we get the full optimized version with the switch now:
check_mask(E):
        cmpl    $9, %edi
        ja      .L3
        movl    $562, %eax
        btq     %rdi, %rax
        setc    %al
        ret
.L3:
        xorl    %eax, %eax
        ret


More information about the Gcc-bugs mailing list