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

Wilco <wilco at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |segher at kernel dot 
crashing.org
            Summary|Combine duplicates count    |[9/10 regression] Combine
                   |trailing zero instructions  |duplicates instructions

--- Comment #8 from Wilco <wilco at gcc dot gnu.org> ---
Here is a much simpler example:

void f (int *p, int y)
{
  int a = y & 14;
  *p = a | p[a];
}

Trunk and GCC9.1 for x64:
        mov     eax, esi
        and     esi, 14
        and     eax, 14
        or      eax, DWORD PTR [rdi+rsi*4]
        mov     DWORD PTR [rdi], eax
        ret

and AArch64:
        and     x2, x1, 14
        and     w1, w1, 14
        ldr     w2, [x0, x2, lsl 2]
        orr     w1, w2, w1
        str     w1, [x0]
        ret

However GCC8.2 does:
        and     w1, w1, 14
        ldr     w2, [x0, w1, sxtw 2]
        orr     w2, w2, w1
        str     w2, [x0]
        ret

So it is a 9 regression...

Reply via email to