From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D0AC0384A01E; Thu, 16 Apr 2020 07:40:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D0AC0384A01E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587022826; bh=wrYcgECyCWouObMpWDSFCHJEqvj5ELs8OgR3mS0iLX4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Lh868NuJjUmpTWIWsDenBJ3VUgQG1D997vthvhg5YrFl1hF7caV9ofIkcqFDUuUnK 0Yc+1PZ1enggjA0c0tPkiPTTUrjK6Y7BrR2RqhWj2ZPB4q+dguc5IgzU7FEQWzV6ZH +3unbOf8gxP1gpo5P8/sNQQ+DLALTRTTD5NYwUWo= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/94614] ICE in emit_move_multi_word, at expr.c:3716 Date: Thu, 16 Apr 2020 07:40:26 +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: 10.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.0 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, 16 Apr 2020 07:40:26 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94614 --- Comment #4 from Richard Biener --- #1 0x0000000000cecacc in emit_move_multi_word (mode=3DE_TImode,=20 x=3D0x7ffff69f66c0, y=3D0x7ffff69f64e0) at /space/rguenther/src/gcc/gcc/expr.c:3716 (gdb) p debug_rtx (x) (subreg:TI (reg/v:DI 113 [ res ]) 0) $3 =3D void (gdb) p debug_rtx (y) (reg/v:TI 115 [ v ]) $4 =3D void so this is another part not expecting the "invalid" source writing outside the bounds of a register. We have /* Do not generate code for a move if it would come entirely from the undefined bits of a paradoxical subreg. */ if (undefined_operand_subword_p (y, i)) continue; but lack the same check for the x parts. The following fixes it: diff --git a/gcc/expr.c b/gcc/expr.c index b97c217e86d..dfbeae71518 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -3692,6 +3692,11 @@ emit_move_multi_word (machine_mode mode, rtx x, rtx = y) need_clobber =3D false; for (i =3D 0; i < CEIL (mode_size, UNITS_PER_WORD); i++) { + /* Do not generate code for a move if it would go entirely + to the non-existing bits of a paradoxical subreg. */ + if (undefined_operand_subword_p (x, i)) + continue; + rtx xpart =3D operand_subword (x, i, 1, mode); rtx ypart;=