https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82325
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|c++ |middle-end --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Note clang 15+ no longer unrolls the loop and even produces really bad code for the loop now: .LBB0_7: # in Loop: Header=BB0_1 Depth=1 addq $2, %rdx .LBB0_1: # =>This Inner Loop Header: Depth=1 movzwl -4(%rax,%rdx,4), %esi cmpl %edi, %esi jg .LBB0_3 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movzbl -2(%rax,%rdx,4), %ecx movl $1, %r8d shll %cl, %r8d addl %esi, %r8d cmpl %edi, %r8d jg .LBB0_8 .LBB0_3: # in Loop: Header=BB0_1 Depth=1 cmpq $29, %rdx je .LBB0_4 # %bb.5: # in Loop: Header=BB0_1 Depth=1 movzwl (%rax,%rdx,4), %esi cmpl %edi, %esi jg .LBB0_7 # %bb.6: # in Loop: Header=BB0_1 Depth=1 movzbl 2(%rax,%rdx,4), %ecx movl $1, %r8d shll %cl, %r8d addl %esi, %r8d cmpl %edi, %r8d jle .LBB0_7