public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/103197] New: ppc inline expansion of memcpy/memmove should not use lxsibzx/stxsibx for a single byte
@ 2021-11-11 18:27 acsawdey at gcc dot gnu.org
  2021-11-11 18:46 ` [Bug target/103197] " acsawdey at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: acsawdey at gcc dot gnu.org @ 2021-11-11 18:27 UTC (permalink / raw)
  To: gcc-bugs

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

            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 <string.h>
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.

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-08-16 23:38 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-11 18:27 [Bug target/103197] New: ppc inline expansion of memcpy/memmove should not use lxsibzx/stxsibx for a single byte acsawdey at gcc dot gnu.org
2021-11-11 18:46 ` [Bug target/103197] " acsawdey at gcc dot gnu.org
2021-11-11 19:36 ` acsawdey at gcc dot gnu.org
2021-11-12 11:19 ` segher at gcc dot gnu.org
2021-11-15 16:02 ` acsawdey at gcc dot gnu.org
2021-11-16 16:40 ` acsawdey at gcc dot gnu.org
2021-11-17 21:40 ` segher at gcc dot gnu.org
2021-11-18  1:31 ` amodra at gmail dot com
2021-11-18 18:11 ` segher at gcc dot gnu.org
2022-01-05 18:15 ` segher at gcc dot gnu.org
2022-01-05 18:18 ` segher at gcc dot gnu.org
2022-01-17  5:51 ` guihaoc at gcc dot gnu.org
2022-02-04  1:51 ` segher at gcc dot gnu.org
2022-04-21 21:31 ` cvs-commit at gcc dot gnu.org
2022-04-21 21:31 ` cvs-commit at gcc dot gnu.org
2022-08-16 21:24 ` [Bug target/103197] [10/11] " cvs-commit at gcc dot gnu.org
2022-08-16 21:24 ` cvs-commit at gcc dot gnu.org
2022-08-16 23:35 ` cvs-commit at gcc dot gnu.org
2022-08-16 23:38 ` segher at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).