From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 462953858C52; Thu, 18 Jan 2024 09:34:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 462953858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705570462; bh=sy032NzIZz0U0pKojb8Fm6czBJuMKPvDbBxFdkjOS9M=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LPJOzXWiDa3EhQaeOX/mW1dsnzSm6cLwbLtWDZePuuMuICpQCE7vMpsfChbJEAoRx 4uUYx0l4yCxHDK6qr6SxzhK+SrnaWcL7NGezItBcrl+6gV9Jz3z23uMe21qx7zCDOz 3MdhrygBW49aEs7yPqtVWPSaGBseELRTOK/01qhU= From: "jakub at gcc dot gnu.org" 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 09:34:21 +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: jakub at gcc dot gnu.org 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 #3 from Jakub Jelinek --- (In reply to Richard Biener from comment #2) > unsigned buflen =3D TREE_INT_CST_LOW (TYPE_SIZE_UNIT (vr->t= ype)) > + 1; > if (INTEGRAL_TYPE_P (vr->type)) > buflen =3D GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (vr->type)= ) + 1; >=20 > there's other spots using the pattern >=20 > if (INTEGRAL_TYPE_P (type)) > sz =3D GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (type)= ); >=20 > I wonder when GET_MODE_SIZE differs from TYPE_SIZE_UNIT? PSImode? I'm afraid I don't know either. > 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? 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)=