From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by sourceware.org (Postfix) with ESMTPS id A34E73858C60 for ; Fri, 7 Jul 2023 06:21:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A34E73858C60 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2b701e1c80fso22124681fa.2 for ; Thu, 06 Jul 2023 23:21:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688710870; x=1691302870; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GCTuJ0a9xBruKf1KOa2m8R0G24VzP8mGcQ/AxiLog7Y=; b=jgOAJIaWXL8c6O/rI4kbws2lne1qi7a5lVsi3qPvRx38drW1S7VJzka3NAMFVkRLXh KLOyqI2QUdFI92I+LRiAdJOg0l1isXJ38ajKS0qGnwIMX4jblLA3ZAUfy24r2PETj8H1 I3ig/VQf0YZpZRqJjqq+G6HEUIDIpeK6H6PzICyC0YnO9ItuwFeLiVbpw3fKNMS7wlmj ki6Y12x1/ZOr3RT0sz4Pb0R2mGSthuROG8pYHbgbKulcdhaXysQHWCo0Q8raFK2h1gGG AisL0SjH1GMUvbvKA2tG7+OcugAlyVa3cqW7eNM7v2yAacGof4qO5cVcO0JrT9DPSi7N j1VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688710870; x=1691302870; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GCTuJ0a9xBruKf1KOa2m8R0G24VzP8mGcQ/AxiLog7Y=; b=cDeak98NLgcC7pZEa06vAzg8d0HOKNYPsT9mu5oCbPhlGO7lqYBFXuA7WdzmsejJkx oEjsII5c/SB0OnrlT1yy4WMMKDQTZSUKg1+pSaWF6y8mxVnEB+ELg5ehf158Jkis9Gk7 sFajD6vU/NHeDJoOeod1qqkCwyaGrcDkxoRlLaGs0PTwWsxpugM1x/g8N1cXuc+Jf2A5 m9ZygWp1120O6X1zB0tAsw997lxPe7BGDcsCfz77wkl/XwN1UJUTIVQiI/ypUiAhBdBn 6b6a5eq6Src3uiurr2TNu4jyuj/V3NqXfxMo6ibHMliZ/qF4Kg2IohyandVczPwAymo+ ZCkg== X-Gm-Message-State: ABy/qLa1PLCqmtd54/4Ib+rz0+xxoVyQ3ZAtM1FWwOAqCnJfEeWOVutE BvMlDr1wplpp+dMLSLB1WWghONrV4Di0VE2+XaU= X-Google-Smtp-Source: APBJJlETxOKj/UD/77gcx6sPZfwzzjmNiugy3U8t2bw+zf0YtnRHnHV1rsrZrdRTvtTd2q+TnRnnXaZh42G5KeeNTCo= X-Received: by 2002:a2e:9206:0:b0:2b6:ba00:f733 with SMTP id k6-20020a2e9206000000b002b6ba00f733mr2025797ljg.18.1688710869845; Thu, 06 Jul 2023 23:21:09 -0700 (PDT) MIME-Version: 1.0 References: <1409622988-14529-1-git-send-email-tsaunders@mozilla.com> <875y6wub1r.fsf@euler.schwinge.homeip.net> In-Reply-To: <875y6wub1r.fsf@euler.schwinge.homeip.net> From: Richard Biener Date: Fri, 7 Jul 2023 08:20:57 +0200 Message-ID: Subject: Re: GGC: Remove 'const char *' 'gt_ggc_mx', 'gt_pch_nx' variants (was: [PATCH] support ggc hash_map and hash_set) To: Thomas Schwinge Cc: gcc-patches@gcc.gnu.org, Richard Biener Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 List-Id: On Thu, Jul 6, 2023 at 8:53=E2=80=AFPM Thomas Schwinge wrote: > > 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"? Are the variants in ggc-page.c/stringpool.cc used? They don't seem to be declared anywhere. I notice that one is for a reference of const char * and one for the value. But yes, I think we should remove the inlines if they are not needed. Thanks, Richard. > > Gr=C3=BC=C3=9Fe > Thomas > > > ----------------- > Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 2= 01, 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch= =C3=A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellsc= haft: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955