public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/101129] [11/12 Regression] wrong code at -O1 since r11-5839
Date: Tue, 13 Jul 2021 19:39:57 +0000	[thread overview]
Message-ID: <bug-101129-4-fj2rMvcQU6@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101129-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think this is a bug in the swaps rs6000 specific pass.
It in particular changes
 (insn 20 19 21 2 (set (reg:DI 155)
         (mult:DI (reg:DI 224)
-            (subreg:DI (reg:V16QI 148) 0))) "pr101129.c":14:8 154 {muldi3}
+            (subreg:DI (reg:V16QI 148) 8))) "pr101129.c":14:8 154 {muldi3}
      (nil))
 (insn 21 20 22 2 (set (reg:DI 156)
         (subreg:DI (mult:TI (zero_extend:TI (reg:DI 224))
-                (zero_extend:TI (subreg:DI (reg:V16QI 148) 0))) 8))
"pr101129.c":14:8 166 {umuldi3_highpart_le}
+                (zero_extend:TI (subreg:DI (reg:V16QI 148) 8))) 0))
"pr101129.c":14:8 166 {umuldi3_highpart_le}
      (nil))

The SUBREG_BYTE changes in subregs of pseudo 148 look reasonable as the pass
removed a xxswapd_v16qi that was swapping the value set to that pseudo.
But the 8 to 0 change of SUBREG_BYTE with SUBREG_REG of MULT looks wrong, that
wouldn't even match unless simplified and turns a highpart multiply into
lowpart multiply.
So either the swaps pass needs to be fixed not to do that, or the highpart
multiply instructions should be changed to e.g. use lshiftrt by 64 instead of
highpart subreg of the result.

  parent reply	other threads:[~2021-07-13 19:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 18:47 [Bug rtl-optimization/101129] New: [11/12 Regression] wrong code at -O1 zsojka at seznam dot cz
2021-06-18 18:49 ` [Bug target/101129] " pinskia at gcc dot gnu.org
2021-06-18 20:39 ` [Bug target/101129] [11/12 Regression] wrong code at -O1 since r11-5839 jakub at gcc dot gnu.org
2021-06-18 20:46 ` jakub at gcc dot gnu.org
2021-06-21  6:18 ` rguenth at gcc dot gnu.org
2021-07-13 19:39 ` jakub at gcc dot gnu.org [this message]
2021-07-13 21:19 ` wschmidt at gcc dot gnu.org
2021-07-14 20:22 ` wschmidt at gcc dot gnu.org
2021-07-14 21:38 ` segher at gcc dot gnu.org
2021-07-14 21:54 ` wschmidt at gcc dot gnu.org
2021-07-15 15:17 ` cvs-commit at gcc dot gnu.org
2021-07-15 15:18 ` wschmidt at gcc dot gnu.org
2021-07-19 17:52 ` cvs-commit at gcc dot gnu.org
2021-07-19 19:42 ` cvs-commit at gcc dot gnu.org
2021-07-19 21:16 ` cvs-commit at gcc dot gnu.org
2021-07-19 21:18 ` wschmidt 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-101129-4-fj2rMvcQU6@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).