From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12026 invoked by alias); 5 Jul 2019 20:31:55 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 12016 invoked by uid 89); 5 Jul 2019 20:31:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=273076 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 05 Jul 2019 20:31:53 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 168F083F3D; Fri, 5 Jul 2019 20:31:52 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-117-97.ams2.redhat.com [10.36.117.97]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B3EB8860D9; Fri, 5 Jul 2019 20:31:51 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id x65KVnxV028424; Fri, 5 Jul 2019 22:31:49 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x65KVlSQ028221; Fri, 5 Jul 2019 22:31:47 +0200 Date: Sat, 06 Jul 2019 01:03:00 -0000 From: Jakub Jelinek To: Paolo Carlini Cc: Jason Merrill , "gcc-patches@gcc.gnu.org" Subject: Re: [C++ Patch] PR 90909 ("[10 Regression] call devirtualized to pure virtual") Message-ID: <20190705203147.GS815@tucnak> Reply-To: Jakub Jelinek References: <774030a9-7b07-b1e0-3219-b6acbf7f3240@redhat.com> <5bf0b3c7-4010-b077-8cf1-9f2935d52931@oracle.com> <2a75dae4-df42-2597-767b-4f4180a9b140@oracle.com> <358ac850-8d4c-99b2-88c6-6e06a2f1c03f@redhat.com> <22c49b96-f534-5a93-bed2-2af7a5e60a2a@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <22c49b96-f534-5a93-bed2-2af7a5e60a2a@oracle.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg00482.txt.bz2 On Thu, Jul 04, 2019 at 02:56:47PM +0200, Paolo Carlini wrote: > --- cp/call.c (revision 273076) > +++ cp/call.c (working copy) > @@ -9845,17 +9852,6 @@ build_new_method_call_1 (tree instance, tree fns, > > if (call != error_mark_node) > { > - /* Optimize away vtable lookup if we know that this > - function can't be overridden. We need to check if > - the context and the type where we found fn are the same, > - actually FN might be defined in a different class > - type because of a using-declaration. In this case, we > - do not want to perform a non-virtual call. */ > - if (DECL_VINDEX (fn) && ! (flags & LOOKUP_NONVIRTUAL) > - && same_type_ignoring_top_level_qualifiers_p > - (DECL_CONTEXT (fn), BINFO_TYPE (binfo)) > - && resolves_to_fixed_type_p (instance, 0)) > - flags |= LOOKUP_NONVIRTUAL; > if (explicit_targs) > flags |= LOOKUP_EXPLICIT_TMPL_ARGS; > /* Now we know what function is being called. */ This change broke bootstrap, as it removes the last use of binfo variable besides the setter of that variable. I'll commit following as obvious if I get successfully past that point in bootstrap: 2019-07-05 Jakub Jelinek PR c++/67184 PR c++/69445 * call.c (build_new_method_call_1): Remove set but not used variable binfo. --- gcc/call.c.jj 2019-07-05 22:09:49.694367815 +0200 +++ gcc/call.c 2019-07-05 22:25:58.476016114 +0200 @@ -9564,7 +9564,7 @@ build_new_method_call_1 (tree instance, struct z_candidate *candidates = 0, *cand; tree explicit_targs = NULL_TREE; tree basetype = NULL_TREE; - tree access_binfo, binfo; + tree access_binfo; tree optype; tree first_mem_arg = NULL_TREE; tree name; @@ -9603,7 +9603,6 @@ build_new_method_call_1 (tree instance, if (!conversion_path) conversion_path = BASELINK_BINFO (fns); access_binfo = BASELINK_ACCESS_BINFO (fns); - binfo = BASELINK_BINFO (fns); optype = BASELINK_OPTYPE (fns); fns = BASELINK_FUNCTIONS (fns); if (TREE_CODE (fns) == TEMPLATE_ID_EXPR) Jakub