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

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ktkachov at gcc dot gnu.org

--- Comment #12 from ktkachov at gcc dot gnu.org ---
r223115 caused a code quality regression that I'm seeing on aarch64 with PR
68381.

We have
int
foo (unsigned short x, unsigned short y)
{
  int r;
  if (__builtin_mul_overflow (x, y, &r))
    __builtin_abort ();
  return r;
}

and before the commit we used to generate:
foo:
        uxth    x0, w0
        uxth    x1, w1
        mul     x0, x0, x1
        cmp     x0, x0, sxtw
        bne     .L9
        ret
.L9:
        stp     x29, x30, [sp, -16]!
        add     x29, sp, 0
        bl      abort

but after r223115 at -O3 on an aarch64 toolchain we generate:
 foo:
        uxth    w0, w0
        uxth    w1, w1
        stp     x29, x30, [sp, -16]!
        umull   x0, w0, w1
        add     x29, sp, 0
        tbnz    w0, #31, .L6
        mov     w2, 0
        cbnz    w2, .L6
        ldp     x29, x30, [sp], 16
        ret
.L6:
        bl      abort

Reply via email to