From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4855D385AC2B; Thu, 11 Nov 2021 18:27:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4855D385AC2B From: "acsawdey at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/103197] New: ppc inline expansion of memcpy/memmove should not use lxsibzx/stxsibx for a single byte Date: Thu, 11 Nov 2021 18:27:48 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 10.3.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: acsawdey at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Thu, 11 Nov 2021 18:27:48 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103197 Bug ID: 103197 Summary: ppc inline expansion of memcpy/memmove should not use lxsibzx/stxsibx for a single byte Product: gcc Version: 10.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: acsawdey at gcc dot gnu.org Target Milestone: --- This got broken sometime in gcc 10 timeframe. For this test case: #include void m(char *a, char *b) { memcpy(a,b,9); } AT13 (gcc 9.3.1) produces: m: .LFB0: .cfi_startproc ld 10,0(4) lbz 9,8(4) std 10,0(3) stb 9,8(3) blr .long 0 .byte 0,0,0,0,0,0,0,0 .cfi_endproc which is the expected code to copy 9 bytes. AT14 (gcc 10.3.1), gcc 11, and current trunk all produce: m: .LFB0: .cfi_startproc addi 10,4,8 ld 9,0(4) lxsibzx 0,0,10 std 9,0(3) addi 9,3,8 stxsibx 0,0,9 blr .long 0 .byte 0,0,0,0,0,0,0,0 .cfi_endproc which is really bad, mixing gpr and vsx. The inline expansion code in expand_block_move() does not attempt to generate vsx code at all unless the size is at least 16 bytes.=