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

--- Comment #8 from Paweł Bylica <chfast at gmail dot com> ---
Since GCC 15 the testcase is even worse because of a different change,
r15-3328-g673a448aa24efedd5ac140ebf7bfe652d7a6a846 (clearing of small padded
objects in gimplify_init_constructor). The return {d, carryout != 0}; now
clears the whole R first, so the padding after carry is kept in memory.

GCC 14.2 (7 instructions):

        cmp     rdi, rsi
        setb    al
        movzx   eax, al
        add     al, -1
        sbb     rdi, rsi
        setc    al
        ret

GCC 15.2 and trunk (14 instructions):

        cmp     rdi, rsi
        mov     DWORD PTR [rsp-40], 0
        movabs  rax, 72057594037927935
        setb    cl
        mov     DWORD PTR [rsp-37], 0
        and     rax, QWORD PTR [rsp-40]
        sal     rax, 8
        mov     rdx, rax
        mov     dl, cl
        mov     rax, rdx
        add     al, -1
        sbb     rdi, rsi
        setc    al
        ret

I filed it separately as PR 127699.

Reply via email to