From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 04DFD385742B; Thu, 14 Jul 2022 10:02:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 04DFD385742B From: "krebbel at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.1.1 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: krebbel at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: krebbel at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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, 14 Jul 2022 10:02:25 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106101 --- Comment #10 from Andreas Krebbel --- We generate the movstrict target operand with gen_lowpart. If the operand f= or gen_lowpart is already a paradoxical subreg the two subregs cancel each oth= er out and we end up with a plain reg. I'm testing the following patch right n= ow. 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 sr= c) rtx low_dest =3D gen_lowpart (smode, dest); rtx low_src =3D 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;=