From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by sourceware.org (Postfix) with ESMTPS id B3A11385771F for ; Wed, 5 Jul 2023 08:18:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B3A11385771F 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-x235.google.com with SMTP id 38308e7fff4ca-2b69dcf45faso104485361fa.0 for ; Wed, 05 Jul 2023 01:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688545110; x=1691137110; 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=q5r9/N3vqeXZQhVLwU2eVoPgJZ8B8mmrxuj7FvveKEo=; b=eygHg0D/BXceaFEcPiufut3aTaRWOlvZPGFNazj+e5PeVQA0l03rG98wNczy3lZiCC AoFCq08nAPQtdUCoPy138Wd8tJFDwUvTGtoxhWKjfKKjpBTO2YfbS780QEfkbBgCRub9 gD7ckl1bm1ERP0YXcuRLDXk4k+8ppYMKnjERUvGBGWoaz9IqiR6eEtBRQj2exn3TsMxn zgt2uOOEaNCD5s/GhVGqV2fr4XdexVrSgI0KXib+z5ptyMAyu0F5pQ0gk+gaWXGG8ofI VPZUzMynpU0hKkBz2h4cAp9JraGxYo0qA5YblCkTXD3qyLIGf3GPphmEO0KnIhQyxxpo WToQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688545110; x=1691137110; 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=q5r9/N3vqeXZQhVLwU2eVoPgJZ8B8mmrxuj7FvveKEo=; b=dCqjuemn+Ia3PYg3M7IKzQLjpSjcz0sXdiBr0RbmSO5qI5BnggVfmGFAh23klta5yP RPoyfTSfjKFC3nqGg+/R71ALP/6Dh0fyzU/9Zcwf/cbghCuX6D0AQqCasq4/ZJ/ueCpj u0ErCwBkjPlZsLUXtof0R2miz0MKocbdnon9UdYvqL9sIeKOGsVMlJ3T3cNQwMwRYHZG vdZNO+qAYfuMWroF/G1XLQzK2qRevTe22+GxPCKaAuqfXa6GOZbmOCMvF0vEItbfhbk3 lzLEnsDmcl2gR/7Me6xlGbQGntT6k4pN53RQr55+qNwHBlu+HQdsFa0l4d999Qwl0oic pG0A== X-Gm-Message-State: ABy/qLYWeO4aHwiIhL/GeTpps5I25Mz52foL9H7H2M+yGhhaGGEM7eD4 BmMftVGncEXgoL26T+XJElMtROyfWjyfnN8Ti1mtYQWc X-Google-Smtp-Source: APBJJlEmFWRjZy77+d5p7MY/KkoIjaD2xKGQJS7tLY9bV4zYc569Yo1sUmg/lNWJ/cKhDGAvs5wYSv6zdzqIa3eyV+0= X-Received: by 2002:a2e:9dce:0:b0:2b6:efcf:1463 with SMTP id x14-20020a2e9dce000000b002b6efcf1463mr4312460ljj.6.1688545109978; Wed, 05 Jul 2023 01:18:29 -0700 (PDT) MIME-Version: 1.0 References: <87h6qjvfp1.fsf@euler.schwinge.homeip.net> <878rbuvljs.fsf@euler.schwinge.homeip.net> In-Reply-To: <878rbuvljs.fsf@euler.schwinge.homeip.net> From: Richard Biener Date: Wed, 5 Jul 2023 10:15:07 +0200 Message-ID: Subject: Re: GTY: Enhance 'string_length' option documentation (was: 'unsigned int len' field in 'libcpp/include/symtab.h:struct ht_identifier' (was: [PATCH] pch: Fix streaming of strings with embedded null bytes)) To: Thomas Schwinge Cc: Lewis Hyatt , gcc-patches@gcc.gnu.org, Richard Sandiford , Jakub Jelinek , David Malcolm Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.6 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 Wed, Jul 5, 2023 at 9:57=E2=80=AFAM Thomas Schwinge wrote: > > Hi! > > On 2023-07-04T15:56:23-0400, Lewis Hyatt via Gcc-patches wrote: > > On Tue, Jul 4, 2023 at 11:50=E2=80=AFAM Thomas Schwinge wrote: > >> I came across this one here on my way working through another (somewha= t > >> related) GTY issue. I generally do understand the issue here, but do > >> have a question about 'unsigned int len' field in > >> 'libcpp/include/symtab.h:struct ht_identifier': [...] > > > I don't think there is currently any possibility for a null byte to > > end up in an ht_identifier's string. I assumed that ht_identifier > > stores the length as an optimization (especially since it doesn't take > > up any extra space on 64-bit platforms, given the 32-bit hash code is > > stored as well there.) I created the string_length GTY markup mainly > > to support another patch that I have still pending review, which I > > thought would increase the likelihood of PCH needing to handle null > > bytes in general. When I did that, I added the markup to ht_identifier > > simply because the length was already there, so there was no reason > > not to add it. It does save a few cycles when streaming out the PCH, > > but I doubt it is meaningful. > > Thanks for confirming. OK thus to push the attached > "GTY: Enhance 'string_length' option documentation"? OK. > 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