[Bug middle-end/98357] Bounds check not eliminated

jmuizelaar at mozilla dot com gcc-bugzilla@gcc.gnu.org
Thu Dec 17 18:39:52 GMT 2020


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

--- Comment #1 from Jeff Muizelaar <jmuizelaar at mozilla dot com> ---
Clang compiles this to:

foo(char*, unsigned long, unsigned long, unsigned long):                       
    # @foo(char*, unsigned long, unsigned long, unsigned long)
        xor     eax, eax
        cmp     rdx, rsi
        jae     .LBB0_3
        cmp     rcx, rdx
        ja      .LBB0_3
        mov     al, byte ptr [rdi + rcx]
.LBB0_3:
        ret

with -O2 -mllvm -enable-constraint-elimination


More information about the Gcc-bugs mailing list