https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90594
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Target| |x86_64-*-*, aarch64 Status|UNCONFIRMED |NEW Last reconfirmed| |2019-05-23 CC| |rguenth at gcc dot gnu.org Target Milestone|--- |9.2 Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Confirmed. x86_64: bad_popcount: .LFB0: .cfi_startproc testl %edi, %edi je .L4 movq %rsi, %rcx movl %edi, %edx .p2align 4,,10 .p2align 3 .L3: xorl %r8d, %r8d addq $4, %rcx tzcntl %edx, %r8d blsr %edx, %edx movl %r8d, -4(%rcx) jne .L3 popcntl %edi, %edi leal -1(%rdi), %eax leaq 4(%rsi,%rax,4), %rax ret this is SCCP doing final value replacement for 'p' and a more general issue of SCCP eliding out-of-loop IV uses just because it can rather than because it will save anything (for example it may elide an induction variable). I've long had the opinion that this separate pass should go away and that we instead should perform this transform only when it enables sth else. So not really a regression, we just got the ability to compute the final value of p in generic infrastructure...