From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 190D63858C3A; Mon, 29 Apr 2024 15:39:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 190D63858C3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714405196; bh=Cz+E3uQ7gdIQnMlgrw9UmWpp8RhgTqCLS0pEbeGQx5g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dGFq+xF9CgvKCbAhyGlXFc5EAA2uxdfWRJAd87v4yUdD2PPIyK/tvUUgux48pBf7X +1N9WcAmSegU/FVlzh3qdHQCH/hlVGCUblDN8PDFiUmq3mRjJS6ZGdmhAM10v6SKyK gB1jQdo1CLFa+Jhj4w9yu+/u1I3OWpq9FRxMlSyQ= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114801] [14/15 Regression] arm: ICE in find_cached_value, at rtx-vector-builder.cc:100 with MVE intrinsics Date: Mon, 29 Apr 2024 15:39:55 +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: 14.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: clyon at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114801 --- Comment #24 from Jakub Jelinek --- Another short term (14.1 only) possibility would be to force_reg a CONST_INT operand into a register if it didn't have all bits the same (and hope combi= ne or whatever else won't simplify it again), i.e. else if (VALID_MVE_PRED_MODE (mode)) { if (CONST_INT_P (x) && (mode =3D=3D V8BImode || mode =3D=3D V4BImode= )) { /* In V8BI or V4BI each element has 2 or 4 bits, if those bits aren't all the same, gen_lowpart might ICE. */ unsigned HOST_WIDE_INT xi =3D UINTVAL (xi); if ((xi & 0x5555) !=3D ((xi >> 1) & 0x5555) || (mode =3D=3D V4BImode && (xi & 0x3333) !=3D ((xi >> 2) & 0x3333))) x =3D force_reg (HImode, x); } else if (SUBREG_P (x)) /* gen_lowpart on a SUBREG can ICE. */ x =3D force_reg (GET_MODE (x), x); x =3D gen_lowpart (mode, x); } If that fixes just the ICE during expansion but ICEs during fwprop, combine etc., then you might try (temporarily) harder and hide the constant from the optimizers, e.g. instead of using force_reg emit some (set (reg:HI) (unspec:HI (const_i= nt ...) UNSPEC_MVE_PRED)) insn that expands like (set (reg:HI) (const_int ...)) but the optimizers don't know that.=