public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/79675] Pointless reg1 <- reg2; reg2 <- reg1 moves inside loop
       [not found] <bug-79675-4@http.gcc.gnu.org/bugzilla/>
@ 2021-08-07  6:17 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: pinskia at gcc dot gnu.org @ 2021-08-07  6:17 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-07  6:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-79675-4@http.gcc.gnu.org/bugzilla/>
2021-08-07  6:17 ` [Bug middle-end/79675] Pointless reg1 <- reg2; reg2 <- reg1 moves inside loop pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).