From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by sourceware.org (Postfix) with ESMTPS id D0BBC3858C2F for ; Mon, 15 Aug 2022 14:03:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D0BBC3858C2F Received: by mail-ej1-x631.google.com with SMTP id dc19so13674801ejb.12 for ; Mon, 15 Aug 2022 07:03:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=wKbvdgvgpmsa1S8mU7AvSX4CE4etjWYGmXG5N2iNeKc=; b=5iGnCcQdTiFhR7mCQibyxRnyK9a/3eSPNE5lq9BvIz0TrBjOamBb3lFeM3f5zqqPMF dG1lCzKUG/Q91EBhji24jbNbDik1BjsudOBymmLiH7Fi/Aqw3UroD1Is+1OuhkuGsDtZ HADyLg+Qg5NZQyQTAgTSJ7k4Z0xcVv0N6X2gbo5LD5J1Jk7MMABA0/mqO/QxEmZpnyR4 wNbUs5MCQd4lTOvOKD9H+fgmq04ugbEJFji+Nc71iz9oVecGNOzRO7egV6+Byy/NODxY fOZoD5keRUtSVBzA2hT6CKV0QXyU2spO2X1FyOa+egSeSrdp1ngsR3TGg+gBjFHktXqF UEDA== X-Gm-Message-State: ACgBeo2It04JqicSfh1LOPe7Um27dfzVwKamEOtIQ3xJgqIFWiI3AoWO 21tzM37vfWkXq2fjbI0d7fm9fA4urvRYVCC/XOs= X-Google-Smtp-Source: AA6agR7H4utEcg2LKlg/p0ik76yPGnzsGLl0Ml6sorj78+IYJqbTwCO5byIQ2SS0oamBB4/Do/LPKxbyLZ6pUKMZCFI= X-Received: by 2002:a17:907:2722:b0:731:23a3:be78 with SMTP id d2-20020a170907272200b0073123a3be78mr10734342ejl.330.1660572194287; Mon, 15 Aug 2022 07:03:14 -0700 (PDT) MIME-Version: 1.0 References: <2FC986DA-9B67-476D-9593-49F1B2BFA2A9@oracle.com> <65809051-2ecf-1f42-ec90-5d5b72935642@acm.org> In-Reply-To: <65809051-2ecf-1f42-ec90-5d5b72935642@acm.org> From: Richard Biener Date: Mon, 15 Aug 2022 16:03:02 +0200 Message-ID: Subject: Re: Where in C++ module streaming to handle a new bitfield added in "tree_decl_common" To: Nathan Sidwell Cc: Qing Zhao , GCC Patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, 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-List-Received-Date: Mon, 15 Aug 2022 14:03:18 -0000 On Mon, Aug 15, 2022 at 3:29 PM Nathan Sidwell via Gcc-patches wrote: > > On 8/2/22 10:44, Qing Zhao wrote: > > Hi, Nathan, > > > > I am adding a new bitfield =E2=80=9Cdecl_not_flexarray=E2=80=9D in =E2= =80=9Ctree_decl_common=E2=80=9D (gcc/tree-core.h) for the new gcc feature = -fstrict-flex-arrays. > > > > =3D=3D=3D=3D > > diff --git a/gcc/tree-core.h b/gcc/tree-core.h > > index ea9f281f1cc..458c6e6ceea 100644 > > --- a/gcc/tree-core.h > > +++ b/gcc/tree-core.h > > @@ -1813,7 +1813,10 @@ struct GTY(()) tree_decl_common { > > TYPE_WARN_IF_NOT_ALIGN. */ > > unsigned int warn_if_not_align : 6; > > > > - /* 14 bits unused. */ > > + /* In FIELD_DECL, this is DECL_NOT_FLEXARRAY. */ > > + unsigned int decl_not_flexarray : 1; > > Is it possible to invert the meaning here -- set the flag if it /IS/ a > flexible array? negated flags can be confusing, and I see your patch > sets it to '!is_flexible_array (...)' anyway? The issue is it's consumed by the middle-end but set by a single (or two) frontends and the conservative setting is having the bit not set. That wor= ks nicely together with touching just the frontends that want stricter behavio= r than currently ... > > + > > + /* 13 bits unused. */ > > > > /* UID for points-to sets, stable over copying from inlining. */ > > unsigned int pt_uid; > > =3D=3D=3D=3D > > > > (Please refer to the following for details: > > > > https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598556.html > > https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598965.html > > > > > ) > > > > Richard mentioned the following: > > > > "I've not seen it so you are probably missing it - the bit has to be > > streamed in tree-streamer-{in,out}.cc to be usable from LTO. Possibly > > C++ module streaming also needs to handle it.=E2=80=9D > > > > I have figured out that where to add the handling of the bit in =E2=80= =9Ctree-streamer-{in, out}.cc, > > However, it=E2=80=99s quite difficult for me to locate where should I a= dd the handling of this new bit in > > C++ module streaming, could you please help me on this? > > > > > add it in to trees_{in,out}::core_bools. You could elide streaming for > non-FIELD_DECL decls. > > Hope that helps. > > nathan > > > > > Thanks a lot for your help. > > > > Qing > > > -- > Nathan Sidwell