public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "krebbel at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/106101] [12/13 Regression] ICE in reg_bitfield_target_p since r12-4428-g147ed0184f403b
Date: Thu, 14 Jul 2022 10:02:24 +0000	[thread overview]
Message-ID: <bug-106101-4-VhdbaZkyjm@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106101-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #10 from Andreas Krebbel <krebbel at gcc dot gnu.org> ---
We generate the movstrict target operand with gen_lowpart. If the operand for
gen_lowpart is already a paradoxical subreg the two subregs cancel each other
out and we end up with a plain reg. I'm testing the following patch right now.
It falls back to a normal move in that case and fixes the testcase:

diff --git a/gcc/config/s390/s390.cc b/gcc/config/s390/s390.cc
index 5aaf76a9490..d90ec1a6de1 100644
--- a/gcc/config/s390/s390.cc
+++ b/gcc/config/s390/s390.cc
@@ -6523,6 +6523,14 @@ s390_expand_insv (rtx dest, rtx op1, rtx op2, rtx src)
          rtx low_dest = gen_lowpart (smode, dest);
          rtx low_src = gen_lowpart (smode, src);

+         /* In case two subregs cancelled each other out, do a normal
+            move.  */
+         if (!SUBREG_P (low_dest))
+           {
+             emit_move_insn (low_dest, low_src);
+             return true;
+           }
+
          switch (smode)
            {
            case E_QImode: emit_insn (gen_movstrictqi (low_dest, low_src));
return true;

  parent reply	other threads:[~2022-07-14 10:02 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27  9:22 [Bug rtl-optimization/106101] New: [12/13 Regression] ICE in reg_bitfield_target_p rguenth at gcc dot gnu.org
2022-06-27  9:22 ` [Bug rtl-optimization/106101] " rguenth at gcc dot gnu.org
2022-06-27  9:22 ` rguenth at gcc dot gnu.org
2022-06-27  9:26 ` rguenth at gcc dot gnu.org
2022-06-27 15:10 ` segher at gcc dot gnu.org
2022-06-28  6:57 ` [Bug target/106101] " rguenth at gcc dot gnu.org
2022-06-28 15:03 ` segher at gcc dot gnu.org
2022-06-28 16:58 ` segher at gcc dot gnu.org
2022-06-29  9:11 ` rguenth at gcc dot gnu.org
2022-06-29 15:48 ` segher at gcc dot gnu.org
2022-07-08 13:56 ` [Bug target/106101] [12/13 Regression] ICE in reg_bitfield_target_p since r12-4428-g147ed0184f403b marxin at gcc dot gnu.org
2022-07-14 10:02 ` krebbel at gcc dot gnu.org [this message]
2022-07-19 11:53 ` krebbel at gcc dot gnu.org
2022-08-24  6:46 ` krebbel at gcc dot gnu.org
2022-08-24 11:57 ` segher at gcc dot gnu.org
2022-08-25 12:40 ` cvs-commit at gcc dot gnu.org
2022-08-25 13:02 ` krebbel at gcc dot gnu.org
2022-08-25 13:55 ` krebbel at gcc dot gnu.org
2022-08-25 15:03 ` segher at gcc dot gnu.org
2023-01-17 15:25 ` [Bug target/106101] [12 " rguenth at gcc dot gnu.org
2023-01-17 15:26 ` rguenth at gcc dot gnu.org
2023-01-23  7:58 ` cvs-commit at gcc dot gnu.org
2023-03-01 13:28 ` rguenth at gcc dot gnu.org
2023-10-10 14:29 ` fw at gcc dot gnu.org
2023-10-10 17:36 ` pinskia at gcc dot gnu.org
2023-10-10 17:39 ` pinskia at gcc dot gnu.org
2023-10-11  6:46 ` fw 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-106101-4-VhdbaZkyjm@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).