From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2C4013858C29; Tue, 16 Jan 2024 11:19:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C4013858C29 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705403994; bh=/cF1Do/TYskyEJMJGdVcpr1jchA4L/YEL3iCDKirofo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hPjsfgIdRONhUg0aj5fjmKlnGixnBDA0a34Cb7oXazkgqUt/JDguzgBYKp2h8wXhO mdltjLdYePGIic9MIu6iT4HCtzvmDOJMUmaDkh3mDoAUXWWdFNmegxcheF5FNG8HRV YaTBnFuICOHV4Y9GfhFE65aoZQdWEl6BSiMK3Un8= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113408] ICE: in handle_cast, at gimple-lower-bitint.cc:1539 at -O with _BitInt() Date: Tue, 16 Jan 2024 11:19:49 +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: UNCONFIRMED 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=3D113408 --- Comment #1 from Jakub Jelinek --- Slightly adjusted: struct A { _BitInt(713) b; } g; int f; void foo (void) { struct A j =3D g; if (j.b) f =3D 0; } The problem is that SRA decides to change: j =3D g; _1 =3D j.b; if (_1 !=3D 0) to j_7 =3D MEM[(struct A *)&g]; _1 =3D VIEW_CONVERT_EXPR<_BitInt(713)>(j_7); if (_1 !=3D 0) where j_7 has _BitInt(768) type, and handle_cast doesn't seem to handle tha= t. So, we need to handle it there, and ideally also tweak SRA so that it keeps= the bitints as is even if they don't have precision in multiple of bytes or wor= ds or whatever SRA rounds to.=