From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by sourceware.org (Postfix) with ESMTPS id 858013858C55 for ; Mon, 15 Aug 2022 13:29:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 858013858C55 Received: by mail-pj1-x1036.google.com with SMTP id p14-20020a17090a74ce00b001f4d04492faso6744848pjl.4 for ; Mon, 15 Aug 2022 06:29:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:cc:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc; bh=mK8/FTVjT3rYJfU8C8zQ5QbFj28FnFORs8VviROziI8=; b=vniU6Ri0GKKXhznAlIfJMnHHB0324p+YZkiOjR76Aeps6OLA5/Gdmk/V2F63x/EfXh XUv5dxe/MBJfrh+T4MvEGbl8QDkvOCADSfCgD3qd07uXzJyx54RcirP1PpshuhIROvID Ipop0kQqVpMOzm4rFtKz+FlP7dLPH3afVnXOCp/Q4vROQrNxPwF03LxlH1XrRfzqdiko ZceMNOhC3SU2dVDc3jolxLu8DWJiVccmDq6Cbc0IqvB/ZP8LsTcgjMvugkKDxczoFCtM fcB2+WcR6eJ6JxBwFLh/0GnRTU0RDggOc/yS3pTuJ7AMulJSDiqI++TPFyM4PjV93pq4 uj3A== X-Gm-Message-State: ACgBeo1jhIGlTA1drpBFOeOmmkIU2xBSPxAq3M0/SON4k/qs78wIAI1p 250INQOibSlGcPpnDGYLLWs= X-Google-Smtp-Source: AA6agR6h1Q+PpBHRvAsoeIK4Su9XM3Q/V/YoUG7nYtqw0sLZ677OWHkHUF2QXFq5u8U3dPqG1l5VKA== X-Received: by 2002:a17:902:ab0f:b0:16d:b787:3ece with SMTP id ik15-20020a170902ab0f00b0016db7873ecemr17309302plb.105.1660570141376; Mon, 15 Aug 2022 06:29:01 -0700 (PDT) Received: from ?IPV6:2620:10d:c085:21cf::116f? ([2620:10d:c090:400::5:4a88]) by smtp.googlemail.com with ESMTPSA id y11-20020a17090322cb00b0016c40f8cb58sm6956730plg.81.2022.08.15.06.28.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Aug 2022 06:29:00 -0700 (PDT) Sender: Nathan Sidwell Message-ID: <65809051-2ecf-1f42-ec90-5d5b72935642@acm.org> Date: Mon, 15 Aug 2022 09:28:58 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: Where in C++ module streaming to handle a new bitfield added in "tree_decl_common" Content-Language: en-US To: Qing Zhao References: <2FC986DA-9B67-476D-9593-49F1B2BFA2A9@oracle.com> Cc: GCC Patches From: Nathan Sidwell In-Reply-To: <2FC986DA-9B67-476D-9593-49F1B2BFA2A9@oracle.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3038.8 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, KAM_SHORT, NICE_REPLY_A, 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 13:29:04 -0000 On 8/2/22 10:44, Qing Zhao wrote: > Hi, Nathan, > > I am adding a new bitfield “decl_not_flexarray” in “tree_decl_common” (gcc/tree-core.h) for the new gcc feature -fstrict-flex-arrays. > > ==== > 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? > + > + /* 13 bits unused. */ > > /* UID for points-to sets, stable over copying from inlining. */ > unsigned int pt_uid; > ==== > > (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.” > > I have figured out that where to add the handling of the bit in “tree-streamer-{in, out}.cc, > However, it’s quite difficult for me to locate where should I add 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