From: Qing Zhao <qing.zhao@oracle.com>
To: Nathan Sidwell <nathan@acm.org>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: Where in C++ module streaming to handle a new bitfield added in "tree_decl_common"
Date: Tue, 16 Aug 2022 13:44:40 +0000 [thread overview]
Message-ID: <6AD940C2-BD52-4400-98B7-74826E650DE3@oracle.com> (raw)
In-Reply-To: <65809051-2ecf-1f42-ec90-5d5b72935642@acm.org>
> On Aug 15, 2022, at 9:28 AM, Nathan Sidwell <nathan@acm.org> wrote:
>
> 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.
Got it. Thanks a lot.
Qing
>
> Hope that helps.
>
> nathan
>
>
>
>> Thanks a lot for your help.
>> Qing
>
>
> --
> Nathan Sidwell
prev parent reply other threads:[~2022-08-16 13:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-02 14:44 Qing Zhao
2022-08-15 13:28 ` Nathan Sidwell
2022-08-15 14:03 ` Richard Biener
2022-08-16 12:16 ` Nathan Sidwell
2022-08-16 12:37 ` Richard Biener
2022-08-16 13:50 ` Qing Zhao
2022-08-16 13:44 ` Qing Zhao [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6AD940C2-BD52-4400-98B7-74826E650DE3@oracle.com \
--to=qing.zhao@oracle.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=nathan@acm.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).