From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 294F0383D034; Mon, 26 Jul 2021 22:20:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 294F0383D034 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/32629] missing CSE for constant in registers / inefficient memset Date: Mon, 26 Jul 2021 22:20:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 4.3.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: DUPLICATE X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: resolution bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jul 2021 22:20:51 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D32629 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE Status|NEW |RESOLVED --- Comment #7 from Andrew Pinski --- 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 ***=