From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3886D3835406; Tue, 22 Jun 2021 09:11:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3886D3835406 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/101162] [12 Regression] ICE (verify_gimple failed) for switch returning pointer-to-members since r12-1608 Date: Tue, 22 Jun 2021 09:11: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: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.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: Tue, 22 Jun 2021 09:11:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101162 --- Comment #2 from Andrew Pinski --- I was just about to assign this to myself as I had just came up with a fix: diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 85e90f42b8e..5e4bdeace1e 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -5361,7 +5361,7 @@ range_check_type (tree etype) else return NULL_TREE; } - else if (POINTER_TYPE_P (etype)) + else if (POINTER_TYPE_P (etype) || TREE_CODE (etype) =3D=3D OFFSET_TYPE) etype =3D unsigned_type_for (etype); return etype; }=