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

--- Comment #5 from luoxhu at gcc dot gnu.org ---
"-O2 -funswitch-loops" could generate expected code for s<=0, unswitch-loops is
enabled by -O3, so this issue is reduced to duplicate of PR67288?

foo:
.LFB0:
        .cfi_startproc
        cmpwi 0,5,0
        blelr 0
        rldicl 5,5,0,32
        addi 4,4,-1
        li 6,0
        li 7,0
        .p2align 4,,15
.L2:
        rldicl 8,5,0,32
        mr 10,4
        mtctr 8
        mr 9,3
        .p2align 5
.L5:
        lbzu 8,1(10)
        cmpw 0,8,7
        bne 0,.L4
        stw 6,0(9)
.L4:
        addi 9,9,4
        bdnz .L5
        addi 6,6,88
        addi 7,7,1
        cmpwi 0,6,8888
        extsw 7,7
        extsw 6,6
        bne 0,.L2
        blr
        .long 0
        .byte 0,0,0,0,0,0,0,0
        .cfi_endproc
.LFE0:

Reply via email to