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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED
   Target Milestone|---                         |9.0

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
On the 9.3+ we get:
.L4:
        ldrb    w0, [x19], 1
        cbz     w0, .L6
.L3:
        sub     x20, x19, #1
        cmp     w21, w0
        bne     .L4
        mov     x2, x23
        mov     x1, x22
        mov     x0, x19
        bl      strncmp
        cbnz    w0, .L4

GCC 7 and 8 got us:
.L9:
        beq     .L8
.L4:
        mov     x20, x19
        mov     x19, x20
        ldrb    w1, [x19], 1
        cmp     w21, w1
        cbnz    w1, .L9
...
.L8:
        .cfi_restore_state
        mov     x2, x22
        mov     x1, x23
        mov     x0, x19
        bl      strncmp
        cbnz    w0, .L4

Which had the moves.

GCC 9+ ch does:
Analyzing loop 1
Loop 1 is not do-while loop: latch has multiple predecessors.
    Will duplicate bb 7
  Not duplicating bb 1: both sucessors are in loop.
Duplicating header of the loop 1 up to edge 7->4, 4 insns.
Loop 1 is do-while loop
Loop 1 is now do-while loop.

While 8- ch has:
Analyzing loop 1
Loop 1 is do-while loop

Which means this was fixed by r9-23.

Reply via email to