public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "acsawdey at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/103197] ppc inline expansion of memcpy/memmove should not use lxsibzx/stxsibx for a single byte
Date: Thu, 11 Nov 2021 18:46:20 +0000	[thread overview]
Message-ID: <bug-103197-4-veIoEeETOb@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103197-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #1 from acsawdey at gcc dot gnu.org ---
Looking at trunk, after expand we have this:

(note 5 1 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK)
(insn 2 5 3 2 (set (reg/v/f:DI 117 [ a ])
        (reg:DI 3 3 [ a ])) "bug2.c":3:1 -1
     (nil))
(insn 3 2 4 2 (set (reg/v/f:DI 118 [ b ])
        (reg:DI 4 4 [ b ])) "bug2.c":3:1 -1
     (nil))
(note 4 3 7 2 NOTE_INSN_FUNCTION_BEG)
(insn 7 4 9 2 (set (reg:DI 119)
        (mem:DI (reg/v/f:DI 118 [ b ]) [0 MEM <char[1:9]> [(void *)b_3(D)]+0 S8
A8])) "bug2.c":4:3 -1
     (nil))
(insn 9 7 8 2 (set (reg:QI 120)
        (mem:QI (plus:DI (reg/v/f:DI 118 [ b ])
                (const_int 8 [0x8])) [0 MEM <char[1:9]> [(void *)b_3(D)]+8 S1
A8])) "bug2.c":4:3 -1
     (nil))
(insn 8 9 10 2 (set (mem:DI (reg/v/f:DI 117 [ a ]) [0 MEM <char[1:9]> [(void
*)a_2(D)]+0 S8 A8])
        (reg:DI 119)) "bug2.c":4:3 -1
     (nil))
(insn 10 8 0 2 (set (mem:QI (plus:DI (reg/v/f:DI 117 [ a ])
                (const_int 8 [0x8])) [0 MEM <char[1:9]> [(void *)a_2(D)]+8 S1
A8])
        (reg:QI 120)) "bug2.c":4:3 -1
     (nil))

Which is the expected code, DI and QI loads/stores that should produce D-form
instructions.

But it looks like reload put the QI into hard reg 32 which is a fp reg:

(insn 9 17 8 2 (set (reg:QI 32 0 [orig:120 MEM <char[1:9]> [(void *)b_3(D)]+8 ]
[120])
        (mem:QI (reg:DI 10 10 [124]) [0 MEM <char[1:9]> [(void *)b_3(D)]+8 S1
A8])) "bug2.c":4:3 549 {*movqi_internal}

which leads to the lxsibzx/stxsibx on output.

  reply	other threads:[~2021-11-11 18:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 18:27 [Bug target/103197] New: " acsawdey at gcc dot gnu.org
2021-11-11 18:46 ` acsawdey at gcc dot gnu.org [this message]
2021-11-11 19:36 ` [Bug target/103197] " 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-103197-4-veIoEeETOb@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).