From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B150C385E82D; Tue, 20 Jul 2021 23:16:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B150C385E82D From: "slyfox at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/101219] [12 Regression] ice in perform_or_defer_access_check since r12-1804-g65870e75616ee435 Date: Tue, 20 Jul 2021 23:16:14 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: slyfox 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 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, 20 Jul 2021 23:16:14 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101219 --- Comment #6 from Sergei Trofimovich --- gcc internals doc says that binfo should be attached to every class/struct (RECORD). I'm not sure if this case qualifies. Maybe? Why this crash happens mechanically? I skimmed through commit 65870e75616ee= 43 ("cp: add support for per-location warning groups.") and found a few places where warning suppression was removed. Returning the one around ptrmem prevents the crash from happening: --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -3326,7 +3326,9 @@ build_ptrmemfunc_access_expr (tree ptrmem, tree member_name) member =3D DECL_CHAIN (member)) if (DECL_NAME (member) =3D=3D member_name) break; - return build_simple_component_ref (ptrmem, member); + tree r =3D build_simple_component_ref (ptrmem, member); + suppress_warning(r); + return r; } /* Given an expression PTR for a pointer, return an expression=