From patchwork Wed Jun 22 15:47:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 55284 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E4B6038344FD for ; Wed, 22 Jun 2022 15:48:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E4B6038344FD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1655912890; bh=prEyLufYw1MuuOjGCs4PM6Bf+bZLBEfs5wu+Qav5qrw=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=G0f8DuhlVsOh5a8deAyISQSCmy0sM7Eio8g3CL3nqVJy7PXumuTQ1Qt9Sk/flYC2Z JfMBA2FBbWPv1Eh3jG6Hr4jnh4bMACrL5vIAEPF4U7pgh9S65WqGZ/Oz3y+nUcQklh Hbbrud9IFFS+N2eaKMPxO/67LhfV8pVY1NtsT40E= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by sourceware.org (Postfix) with ESMTPS id D6ECD385624E for ; Wed, 22 Jun 2022 15:47:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D6ECD385624E Received: by mail-qk1-x729.google.com with SMTP id f14so108258qkm.0 for ; Wed, 22 Jun 2022 08:47:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :content-language:to:from:subject; bh=prEyLufYw1MuuOjGCs4PM6Bf+bZLBEfs5wu+Qav5qrw=; b=FmMo/2Gy+2x1gVFgDs4OWyAbTYHnZhZH5vUPyQROrLHHyF3Aw2zw00Y6XvPSmrhGHz 42pLsHyF3WAB+tbUXOHs6kFMQ8/ggqgTzlFDGQUbz5dgSMrv9m4G/74j8S6gglt5Tayf Si58amY+xFbFxi51StdpzbjlrCDaIanNiUOejqmceW5p02K3kzbrsNkPxlUjcKGfMeQI eG7Ez9wLQjJ8KrD0ln0dWsbVESmX8EYX+jGmFEJc+dr2aBDWRyb43DlexbQrjm7ADbU1 LiC7OZ6jN0PklfhR4R0o9wzF1lxdX4ogla5tKum88d5yLw5x7vZmhjAaUg+bb7HU/jbG fT7g== X-Gm-Message-State: AJIora/B8ZYl7M0BEil7Mvg+yihs+jj0ElFazautBfHTXynkXLYo5gll aNg1iSpSXYmCKNkg/a4DmjyEUcs0SBI= X-Google-Smtp-Source: AGRyM1u3ol0WEV2G/L3rJLZBCpb9qNima+aXF5hC/uha2lKEyEmTkVNkMdTJxbxSbbZxIAXDlTpHEw== X-Received: by 2002:ae9:dc42:0:b0:6a6:7b4b:1636 with SMTP id q63-20020ae9dc42000000b006a67b4b1636mr2783937qkf.111.1655912860818; Wed, 22 Jun 2022 08:47:40 -0700 (PDT) Received: from ?IPV6:2620:10d:c0a3:1407:9e17:5568:4e4b:32e? ([2620:10d:c091:500::3:72ff]) by smtp.googlemail.com with ESMTPSA id cc12-20020a05622a410c00b003050032703fsm14667934qtb.64.2022.06.22.08.47.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Jun 2022 08:47:38 -0700 (PDT) Message-ID: Date: Wed, 22 Jun 2022 11:47:37 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Content-Language: en-US To: GCC Patches Subject: c++: Remove ifdefed code X-Spam-Status: No, score=-3038.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-Patchwork-Original-From: Nathan Sidwell via Gcc-patches From: Nathan Sidwell Reply-To: Nathan Sidwell Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" The only reason I chose to use DECL_UID on this hash table was to make it stable against ASLR and perturbations due to other allocations. It's not required for correctness, as the comment mentions the equality fn uses pointer identity. nathan From d844478ab47a16c8ae65f253fd1cdc685c7951fc Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Wed, 22 Jun 2022 07:51:44 -0700 Subject: [PATCH] c++: Remove ifdefed code The only reason I chose to use DECL_UID on this hash table was to make it stable against ASLR and perturbations due to other allocations. It's not required for correctness, as the comment mentions the equality fn uses pointer identity. gcc/cp/ * module.cc (struct duplicate_hash): Remove. (duplicate_hash_map): Adjust. --- gcc/cp/module.cc | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index b3fbd467ecb..d735d7e8b30 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -2829,24 +2829,10 @@ struct merge_key { } }; -struct duplicate_hash : nodel_ptr_hash -{ -#if 0 - /* This breaks variadic bases in the xtreme_header tests. Since ::equal is - the default pointer_hash::equal, let's use the default hash as well. */ - inline static hashval_t hash (value_type decl) - { - if (TREE_CODE (decl) == TREE_BINFO) - decl = TYPE_NAME (BINFO_TYPE (decl)); - return hashval_t (DECL_UID (decl)); - } -#endif -}; - /* Hashmap of merged duplicates. Usually decls, but can contain BINFOs. */ typedef hash_map > + simple_hashmap_traits,uintptr_t> > duplicate_hash_map; /* Tree stream reader. Note that reading a stream doesn't mark the -- 2.30.2