From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7E7D23852C6E; Thu, 17 Nov 2022 20:24:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7E7D23852C6E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668716680; bh=p7K9HS7z4EoiymSH31ucGKhxTuHjPoGQe/neWW8w/Bc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=tugddMN1raq3e6m3RjVtnkemBeDnzxAkA7ameIAfciExYOd7VKSMNRgPgQHYqrIQq 2T0FZq+hDUKRR+vAeDKqG75fVoqYFuOO73qe4c25VTjVFIwBLrM4ozkzul/y/ISMRI IHSR3QoxPLaBGeixP2ZiGNP0hqMECWOceDKzGIBY= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/107307] [12/13 Regression] ICE tree check: expected class 'type', have 'exceptional' (error_mark) in canonicalize_component_ref, at gimplify.cc:2923 since r12-3278-g823685221de986af Date: Thu, 17 Nov 2022 20:24:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: error-recovery, ice-checking, ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 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=3D107307 --- Comment #2 from Andrew Pinski --- Simple fix: diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc index f06ce3cc77a..bd772c15bec 100644 --- a/gcc/gimplify.cc +++ b/gcc/gimplify.cc @@ -3319,7 +3319,9 @@ gimplify_compound_lval (tree *expr_p, gimple_seq *pre= _p, gimple_seq *post_p, } /* If the outermost expression is a COMPONENT_REF, canonicalize its type= .=20 */ - if ((fallback & fb_rvalue) && TREE_CODE (*expr_p) =3D=3D COMPONENT_REF) + if (ret !=3D GS_ERROR + && (fallback & fb_rvalue) + && TREE_CODE (*expr_p) =3D=3D COMPONENT_REF) { canonicalize_component_ref (expr_p); } I am going to submit this and PR 106764 together.=