From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38034 invoked by alias); 22 Sep 2017 20:20:56 -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 37999 invoked by uid 89); 22 Sep 2017 20:20:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 22 Sep 2017 20:20:54 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id B540B823C1; Fri, 22 Sep 2017 22:20:51 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UspNxR21RD7r; Fri, 22 Sep 2017 22:20:51 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 8BBF5823C0; Fri, 22 Sep 2017 22:20:51 +0200 (CEST) From: Eric Botcazou To: Jason Merrill Cc: gcc-patches@gcc.gnu.org, Richard Biener Subject: Re: [C++] Fix PR bootstrap/81926 Date: Fri, 22 Sep 2017 20:20:00 -0000 Message-ID: <11616972.pR5rpf8R4I@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-53-desktop; KDE/4.14.9; x86_64; ; ) In-Reply-To: References: <4078981.6jQ9KEkrUD@polaris> <1514184.0xIGq3mKY2@polaris> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart65514613.pOkBoClWSh" Content-Transfer-Encoding: 7Bit X-SW-Source: 2017-09/txt/msg01572.txt.bz2 This is a multi-part message in MIME format. --nextPart65514613.pOkBoClWSh Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Content-length: 389 > This looks good. But let's call it debug_type_hash instead. OK with > that change. Thanks. It occured to me that we don't need to look up the type twice when we need to insert it so I have installed the attached patchlet as obvious after boostrapping/regtesting on x86-64/Linux. PR bootstrap/81926 * cp-objcp-common.c (cp_get_debug_type): Do only one lookup. -- Eric Botcazou --nextPart65514613.pOkBoClWSh Content-Disposition: attachment; filename="pr81926-2b.diff" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="pr81926-2b.diff" Content-length: 1195 Index: cp-objcp-common.c =================================================================== --- cp-objcp-common.c (revision 253049) +++ cp-objcp-common.c (working copy) @@ -162,13 +162,13 @@ cp_get_debug_type (const_tree type) types on the fly for the debug info only, they would not be attached to any GC root and always be swept, so we would make the contents of the debug info depend on the collection points. */ - struct tree_map in, *h; + struct tree_map in, *h, **slot; in.base.from = CONST_CAST_TREE (type); in.hash = htab_hash_pointer (type); - h = debug_type_hash->find_with_hash (&in, in.hash); - if (h) - return h->to; + slot = debug_type_hash->find_slot_with_hash (&in, in.hash, INSERT); + if (*slot) + return (*slot)->to; tree t = build_offset_type (TYPE_PTRMEMFUNC_OBJECT_TYPE (type), TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (type))); @@ -177,7 +177,7 @@ cp_get_debug_type (const_tree type) h->base.from = CONST_CAST_TREE (type); h->hash = htab_hash_pointer (type); h->to = t; - *debug_type_hash->find_slot_with_hash (h, h->hash, INSERT) = h; + *slot = h; return t; } --nextPart65514613.pOkBoClWSh--