From patchwork Thu Jul 6 18:53:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 116822 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2766705vqx; Thu, 6 Jul 2023 11:53:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlHX+mzUiTYnUUJuelhShybTZTzUffqQnDIplsKluy2WbfyR+jLktOkApdYxO5sy2zeVaAKY X-Received: by 2002:aa7:dad8:0:b0:51d:d4c3:6858 with SMTP id x24-20020aa7dad8000000b0051dd4c36858mr2233524eds.12.1688669625114; Thu, 06 Jul 2023 11:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688669625; cv=none; d=google.com; s=arc-20160816; b=KcmaqDhKkVjuY3M2P+JePDmeZan1zsapzXybY30Ljr1szWfKzNBxBg4z9zdR7Yd3NO fyo6B8HWNKKKb8N+1I5MM9SvBQf6jPudeZtYv5DV2PS398mp3t3wzT2KarPe001LFD83 2W/Bj/Gll7w0URCuIuqR847KJdp6J3KAIm91FWOEktwvX5yEl+x9gze9lywdX0EZfBZe Gpu9WdC6XLWtsOokQWWJxFiE3VQowNKMUECGrQGCI4V69lFAp9YgdIB0ikZ4sxBTGuXS 49cRP+LMeLWXiUyrDMEY5/RcuAhrV1mSLgTgPtNcugdM5KtI2Xz1N7ORcI4sR/rjtm4b 9p6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:message-id:date :user-agent:references:in-reply-to:subject:cc:to:from:ironport-sdr :dmarc-filter:delivered-to; bh=jzHNkUsXypL7FePP943MDB85IAN9hzrJ39fOKxo8ddc=; fh=AqOsmYkSSjJgQ750xO4zzbiTXmu/GuVCOfi1VG3MnvM=; b=YrhJ6mTKXyoXTd68Fs2xeYjmdvtn/X64taPqRw+DT4XksvwLjC2LDQ/1W0XscJppbq wxH6B78qAcchhaYgyN7RuldDVa5/jDSMxQkY8/ESBL+5WI3Zy+2tCgRKQQivmRexeWai hsQ0aXvPnrLaWMzYiOUC1v+pNyRWms+aUC5Yk0hEOW956h4sbHiDHmny2968JKiD+5Im g4VaBxPMCXEz7rAnqGtB+xpekyEU5sRepOWM4+rci8TwqBmSK5k7Yl6BH/u6//+a0UmO LcqUZt04mnppi82E472KQ18plORHeAMRNX7jnkmdkUU+wZi1MDWJfoI724DflqTKzE2l intw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id b21-20020aa7df95000000b0051de11a08e9si1127605edy.246.2023.07.06.11.53.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 11:53:45 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B1D6B385558C for ; Thu, 6 Jul 2023 18:53:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id CDC613858D33 for ; Thu, 6 Jul 2023 18:53:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CDC613858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="6.01,185,1684828800"; d="scan'208,223";a="11165094" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 06 Jul 2023 10:53:11 -0800 IronPort-SDR: PL17eo/PMQy9YJK5hAqf6daw1KNlEgmcBegT4Fl2CqfRZHGvtl+Naml+RUJ3sMgA4/nqVHE0L+ 0X5caV6Ei95Qr6hWZkZcedMtA2F3n0LBVkpcRZLeFh+yR98GAu6Ki0ZiXV+tY6ui37naVIV9tk uscZxbWbN/2OP7dTo2MLj6B8ZpRdJM4vnMqmzNzdJBm0ZbpLDOeWoI0u9K9+fyr0QAwuIvgSce RAK1wzL7hsJQJGwIB/I1k0bkS72qn1732CUA3mvfANInnRv0sPAduluCOoVfif81z02sRR2Mdb PQs= From: Thomas Schwinge To: CC: Richard Biener Subject: GGC: Remove 'const char *' 'gt_ggc_mx', 'gt_pch_nx' variants (was: [PATCH] support ggc hash_map and hash_set) In-Reply-To: <1409622988-14529-1-git-send-email-tsaunders@mozilla.com> References: <1409622988-14529-1-git-send-email-tsaunders@mozilla.com> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Thu, 6 Jul 2023 20:53:04 +0200 Message-ID: <875y6wub1r.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770698440838765627?= X-GMAIL-MSGID: =?utf-8?q?1770698440838765627?= Hi! On 2014-09-01T21:56:28-0400, tsaunders@mozilla.com wrote: > [...] this part [...] ... became commit b086d5308de0d25444243f482f2f3d1dfd3a9a62 (Subversion r214834), which added GGC support to 'hash_map', 'hash_set', and converted to those a number of 'htab' instances. It doesn't really interfere with my ongoing work, but I have doubts about two functions that were added here: > --- a/gcc/ggc.h > +++ b/gcc/ggc.h > +static inline void > +gt_ggc_mx (const char *s) > +{ > + ggc_test_and_set_mark (const_cast (s)); > +} > + > +static inline void > +gt_pch_nx (const char *) > +{ > +} If (in current sources) I put '__builtin_abort' calls into these functions, those don't trigger, so the functions are (currently) unused, at least in my configuration. Moreover, comparing these two to other string-related 'gt_ggc_mx' functions in (nowadays) 'gcc/ggc-page.cc', and string-related 'gt_pch_nx' functions in (nowadays) 'gcc/stringpool.cc' (..., which already did exist back then in 2014), we find that this 'gt_ggc_mx' doesn't call 'gt_ggc_m_S', so doesn't get the special string handling, and this 'gt_pch_nx' doesn't call 'gt_pch_n_S' and also doesn't 'gt_pch_note_object' manually, so I wonder how that ever worked? So maybe these two in fact never were used? Should we dare to put in the attached "GGC: Remove 'const char *' 'gt_ggc_mx', 'gt_pch_nx' variants"? Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 From a1341d0e75ab20ee9ba09a1a8428c9d3dd2fd54a Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Thu, 6 Jul 2023 17:44:35 +0200 Subject: [PATCH] GGC: Remove 'const char *' 'gt_ggc_mx', 'gt_pch_nx' variants Those were added in 2014 commit b086d5308de0d25444243f482f2f3d1dfd3a9a62 (Subversion r214834) "support ggc hash_map and hash_set". If (in current sources) I put '__builtin_abort' calls into these functions, those don't trigger, so the functions are (currently) unused, at least in my configuration. Moreover, comparing these two to other string-related 'gt_ggc_mx' functions in (nowadays) 'gcc/ggc-page.cc', and string-related 'gt_pch_nx' functions in (nowadays) 'gcc/stringpool.cc' (..., which already did exist back then in 2014), we find that this 'gt_ggc_mx' doesn't call 'gt_ggc_m_S', so doesn't get the special string handling, and this 'gt_pch_nx' doesn't call 'gt_pch_n_S' and also doesn't 'gt_pch_note_object' manually, so I wonder how that ever worked? So maybe these two in fact never were used? gcc/ * ggc.h (gt_ggc_mx (const char *s), gt_pch_nx (const char *)): Remove. --- gcc/ggc.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/gcc/ggc.h b/gcc/ggc.h index 78eab7eaba6..1f3d665fc57 100644 --- a/gcc/ggc.h +++ b/gcc/ggc.h @@ -331,17 +331,6 @@ ggc_alloc_cleared_gimple_statement_stat (size_t s CXX_MEM_STAT_INFO) return (gimple *) ggc_internal_cleared_alloc (s PASS_MEM_STAT); } -inline void -gt_ggc_mx (const char *s) -{ - ggc_test_and_set_mark (const_cast (s)); -} - -inline void -gt_pch_nx (const char *) -{ -} - inline void gt_pch_nx (bool) { } inline void gt_pch_nx (char) { } inline void gt_pch_nx (signed char) { } -- 2.34.1