From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 84111385842D; Thu, 18 Jan 2024 10:06:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 84111385842D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705572378; bh=cwqZItUXMLsgu1BUQC8uDd7TbbLtVyT7Fyn26E9uP9k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xzQJcd5Q73aRAn0v9QjA6WGTWuUuriqK2KqrxE4eeccUoDr6ezuyx11LECup/xC4d ApRKmjDjTmVz+w5vnrozikuWdP1uG/9CkgV99zmICxgqdiYAQJIqtSHIxgU9NXH0CE G/WUvQoVrAeWbCR9w8YG+CPK2JrZbZPlcrrE7kAM= From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113459] ICE: in as_a, at machmode.h:381 with memset() on a _BitInt() at -O1 and above Date: Thu, 18 Jan 2024 10:06:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D113459 --- Comment #4 from rguenther at suse dot de --- On Thu, 18 Jan 2024, jakub at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113459 >=20 > --- Comment #3 from Jakub Jelinek --- > (In reply to Richard Biener from comment #2) > > unsigned buflen =3D TREE_INT_CST_LOW (TYPE_SIZE_UNIT (vr-= >type)) > > + 1; > > if (INTEGRAL_TYPE_P (vr->type)) > > buflen =3D GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (vr->typ= e)) + 1; > >=20 > > there's other spots using the pattern > >=20 > > if (INTEGRAL_TYPE_P (type)) > > sz =3D GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (typ= e)); > >=20 > > I wonder when GET_MODE_SIZE differs from TYPE_SIZE_UNIT? PSImode? >=20 > I'm afraid I don't know either. >=20 > > Packed bitfields? r10-6885-g5f9cd512c42786 added the INTEGRAL_TYPE_P > > special-casing we now run into with the TYPE_SIZE_UNIT code being there > > before. > >=20 > > Jakub, do you remember? >=20 > I bet the above comes from what the native_{encode,interpret}_int has been > doing (and which has been tweaked for BITINT_TYPE). > If we don't want to throw it away, we could just change it to > if (INTEGRAL_TYPE_P (...) && TYPE_MODE (...) !=3D BLKmode) Yeah, that might work. There are a few occurances in tree-ssa-sccvn.cc that need such adjustment.=