[Bug rtl-optimization/32629] missing CSE for constant in registers / inefficient memset

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jul 26 22:20:50 GMT 2021


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
On the trunk at -O2 we have:
        pxor    %xmm0, %xmm0
        movups  %xmm0, (%rdi)
        movups  %xmm0, 16(%rdi)
        movups  %xmm0, 32(%rdi)
        pxor    %xmm0, %xmm0
        movups  %xmm0, 48(%rdi)
        movups  %xmm0, 64(%rdi)
        ret

With -mno-sse we get:
        movq    $0, (%rdi)
        movq    $0, 8(%rdi)
        movq    $0, 16(%rdi)
        movq    $0, 24(%rdi)
        movq    $0, 32(%rdi)
        movq    $0, 40(%rdi)
        movq    $0, 48(%rdi)
        movq    $0, 56(%rdi)
        movq    $0, 64(%rdi)
        movq    $0, 72(%rdi)
        ret

at -Os we get:
        xorl    %eax, %eax
        leaq    48(%rdi), %rdx
        movl    $8, %ecx
        movq    %rax, (%rdi)
        movq    %rax, 8(%rdi)
        movq    %rax, 16(%rdi)
        movq    %rax, 24(%rdi)
        movq    %rax, 32(%rdi)
        movq    %rax, 40(%rdi)
        xorl    %eax, %eax
        movq    %rdx, %rdi

Which was implemented by PR 11877.
So I am going to close this as a dup of bug 11877.

*** This bug has been marked as a duplicate of bug 11877 ***


More information about the Gcc-bugs mailing list