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
