From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 7D41F38515F6; Fri, 23 Jul 2021 21:32:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7D41F38515F6 Date: Fri, 23 Jul 2021 22:32:15 +0100 From: Sergei Trofimovich To: Jeff Law Cc: gcc-patches@gcc.gnu.org, Sergei Trofimovich , Martin Sebor Subject: Re: [PATCH] c++: suppress all warnings on memper pointers to work around dICE [PR101219] Message-ID: <20210723223215.3f451dc4@zn3> In-Reply-To: <387e2a61-a895-733d-5418-7c8c38d6f998@gmail.com> References: <20210722231524.2045951-1-slyfox@gentoo.org> <387e2a61-a895-733d-5418-7c8c38d6f998@gmail.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.29; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 21:32:24 -0000 On Fri, 23 Jul 2021 10:33:09 -0600 Jeff Law wrote: > On 7/22/2021 5:15 PM, Sergei Trofimovich via Gcc-patches wrote: > > From: Sergei Trofimovich > > > > r12-1804 ("cp: add support for per-location warning groups.") among other > > things removed warning suppression from a few places including ptrmemfuncs. > > > > Currently ptrmemfuncs don't have valid BINFO attached which causes ICEs > > in access checks: > > > > crash_signal > > gcc/toplev.c:328 > > perform_or_defer_access_check(tree_node*, tree_node*, tree_node*, int, access_failure_info*) > > gcc/cp/semantics.c:490 > > finish_non_static_data_member(tree_node*, tree_node*, tree_node*) > > gcc/cp/semantics.c:2208 > > ... > > > > The change suppresses warnings again until we provide BINFOs for ptrmemfuncs. > > > > PR c++/101219 > > > > gcc/cp/ChangeLog: > > > > * typeck.c (build_ptrmemfunc_access_expr): Suppress all warnings > > to avoid ICE. > > > > gcc/testsuite/ChangeLog: > > > > * g++.dg/torture/pr101219.C: New test. > The C++ maintainers have the final say here, but ISTM that warning > suppression shouldn't be used to avoid an ICE, even an ICE within the > warning or diagnostic code itself. Sounds good. I agree fixing it correctly is preferable and should improve diagnostic on this very test case compared to gcc-11. I'll need some help plumbing TYPE_BINFO() around build_ptrmemfunc_type(). My attempts to use `xref_basetypes (t, NULL_TREE);` to derive it for a fresh expression only shuffles ICEs around. -- Sergei