https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125456
--- Comment #4 from Hu Lin <lin1.hu at intel dot com> ---
I tried the two RTL options you mentioned: -fvariable-expansion-in-unroller is
no effect. -fno-split-ivs-in-unroller avoids the regression, but disables the
entire apply_opt_in_copies path.
The output is:
.L55:
addq $4, %rdi
cmpq %rdi, %rsi
je .L4
.L2:
cmpl %edx, (%rdi)
je .L5
addq $4, %rdi
.L53:
cmpl %edx, (%rdi)
je .L5
addq $4, %rdi
.L35:
cmpl %edx, (%rdi)
je .L5
addq $4, %rdi
.L34:
cmpl %edx, (%rdi)
je .L5
addq $4, %rdi
.L33:
cmpl %edx, (%rdi)
je .L5
addq $4, %rdi
.L32:
cmpl %edx, (%rdi)
je .L5
addq $4, %rdi
.L31:
cmpl %edx, (%rdi)
je .L5
addq $4, %rdi
.L30:
cmpl %edx, (%rdi)
jne .L55
I think the case is worse than mine.