Message ID | 2FC986DA-9B67-476D-9593-49F1B2BFA2A9@oracle.com |
---|---|
State | New, archived |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6a10:b5d6:b0:2b9:3548:2db5 with SMTP id v22csp3028065pxt; Tue, 2 Aug 2022 07:45:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR4B2zvpKIrSnI4eyJBNO/PJPPW9YoSe/JfMlXE8xZSFcyWHpIS+nUU8mu0tYW2fjoVpp62T X-Received: by 2002:a17:907:e90:b0:730:8f6b:c14e with SMTP id ho16-20020a1709070e9000b007308f6bc14emr6516055ejc.250.1659451524287; Tue, 02 Aug 2022 07:45:24 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h7-20020a0564020e0700b0043c19cd608dsi11999686edh.33.2022.08.02.07.45.24 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Aug 2022 07:45:24 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=yo79Hton; arc=fail (signature failed); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 301EA385274B for <ouuuleilei@gmail.com>; Tue, 2 Aug 2022 14:45:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 301EA385274B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1659451523; bh=2avjYz0jWpOh3u48etJZO1vcPxpy8lx77qUdZWt/BIE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=yo79HtonuZ3jL1YEkz19ULk2acNJNiw8fkWr4acHS3uw5nCcBOJIns2mV4GtO+rLR EBBChGEEgxpOusuEGNKi1049jVL8zEMFsT4rQslazoEU2jzz2eR7CmEf8XV0KorOdC 1EJWKTw+BXNI4utEVRyHZxwBj8NhOlXZMxnZz1bc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id E14D338582A7 for <gcc-patches@gcc.gnu.org>; Tue, 2 Aug 2022 14:44:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E14D338582A7 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 272Ehk2x021980; Tue, 2 Aug 2022 14:44:32 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hmv8s72dv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 02 Aug 2022 14:44:31 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 272DdI8m031906; Tue, 2 Aug 2022 14:44:31 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3hmu32cpeu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 02 Aug 2022 14:44:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=agZ8jC5blP6pjb6Po1NngMvD+zgmQE13U9kvyQXinG+RrzsG2tfTr29Soibjd48GdD3HbDLezZJNptSIS+NQOsEzYR1xeHscUbX13b/PbgEK97M7JiV/jk3JFQdGNwodo4dG/JF/odrFdAptDN0gYVLkBhOS90Z390EsYkAx4edto2790Psee/95xjycG/LTQTBwv3eX+3txOqh97VGfykaR46oCeUN7hEI+j9AzacI82zu0G6WQtl0umZp5TCejqsMDsdFa4FOcZJKbiAuSQIpAaX+u82+ds+ItpDtGN1U1uZ1/PwNqwbwo/Fu8hku6SlwFZB0W5+ac4ps4W+gWvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2avjYz0jWpOh3u48etJZO1vcPxpy8lx77qUdZWt/BIE=; b=LgafyBq//mAmQHAVcY02Pk+MR7hiAxm68pWbqb4ePk5NUUV3RZZhmuobOwXQ/eSY7a6V1BKUrIKMM15RkIq08h099ZmAM2atsZ4ZKTKOsRI37nqeoSxVzdOro8LUxqTJiUtdmBkM0FfAQtQrlrtxsDnOzeJ1p/eXVGddI2qiq78u1mJxiuLQljdQMStWqQ52Mkn6i3z1ZF60Le9LOdelrOU5aTamNZ14oYTi68Sx/2FHIiDI1Ymakam95gl6j4kThJkS1/Rhv1mPd1fTQ099gG+Wk3xTScOTGrv3x22GzHj7aHSOYEq/H0AvMbwwuycrgMndKAnbwfBR4RgpHYaV2g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none Received: from CH2PR10MB4344.namprd10.prod.outlook.com (2603:10b6:610:af::19) by PH0PR10MB5594.namprd10.prod.outlook.com (2603:10b6:510:f6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.12; Tue, 2 Aug 2022 14:44:28 +0000 Received: from CH2PR10MB4344.namprd10.prod.outlook.com ([fe80::84af:9275:f1d7:de1]) by CH2PR10MB4344.namprd10.prod.outlook.com ([fe80::84af:9275:f1d7:de1%5]) with mapi id 15.20.5482.016; Tue, 2 Aug 2022 14:44:28 +0000 To: "Nathan@acm.org" <Nathan@acm.org> Subject: Where in C++ module streaming to handle a new bitfield added in "tree_decl_common" Thread-Topic: Where in C++ module streaming to handle a new bitfield added in "tree_decl_common" Thread-Index: AQHYpn5eeEH8IZNbLUCwcadyLyCA4A== Date: Tue, 2 Aug 2022 14:44:28 +0000 Message-ID: <2FC986DA-9B67-476D-9593-49F1B2BFA2A9@oracle.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Apple Mail (2.3608.120.23.2.7) x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fa0f3247-9b48-4d1e-7f73-08da749580c2 x-ms-traffictypediagnostic: PH0PR10MB5594:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fttB4vHpxcPfTOEsr+/azIGFGytOtnS2SbtQcBB412/CAsobTCgiYC8dA1DLW88wXBHzeJTmyRhmM06djxx9h86gC5OFqEi7L7GKpFh5LSeCBuvYLFEr7AfDc871En3YIwrv8SOPT2kzmIEKz24P0IHPtxPNaohly6FmeB4ReBdspHiVeHyZP0NufeaYuVreEVXQ2zOa3OIkm+ycI5v+DCuWjiRjCHQheG7H8079IVTkYfzjyWgK4sxS6n2xkdkdBBUbvKzhwmV2FirQZ9O4lU+ZmPMzQwZ5X5eleTKomPyPrCIXSAZLuuHVcXbjti7msBZLaUfpIB1Xh3jp9imdEVlGFj15vzDBz0/Hv80MSpI6RsX8RdpXOulPBXg7Q61hFP4iCrrGKDTl5h2rG/t69QP90bVJ/ogphdpgvTcgtlcRdwAfOylzMARa6l0ccBo/MxaEALQr7isi9rbnfsNs555Hv6qZ0kO0dZyMs6TefZZAeVN8DaJUSgbAtstZORwESOyw2Q+63DDdEZ36JgdqlZC++SnX4Y9E9RxpWZkizt/k/ZFmfYrLmw9nZyXfzTMfco1yd62Fh0TeP05BZDbjBJxk9MSTk0tWyotn5QCdRn7ve4Tkf/gJ4ILvOOFGYDxlcFgYnJli3ZP2oNbd3y4nYjD9ANcIiEo9TL8/uePD0mOMNR7XpyaTyehFGV+6ei77469qK60cl/a93wjGU7Gc61DvDQ1dA6po6l5FPhXmK9PMC9ajzp56MOq0U+ejmrA99lFnuE/Sdi8J6jP/kuh0fl1+HwfvnBSwa50Hv+OiKkK0Q3v4xYUdTc7rsCOqpYK4WAzPpdgqPiyDtG49Q3DqoPaMwBj8s+X2rI+xbUfAm+bNlRzgSgQXsY9xNW8E2+8l1NmN34ML1syib9cCoXkp/A== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR10MB4344.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(346002)(376002)(39860400002)(366004)(396003)(136003)(6486002)(966005)(33656002)(5660300002)(86362001)(316002)(64756008)(71200400001)(66946007)(76116006)(91956017)(66556008)(8936002)(8676002)(66476007)(4326008)(6916009)(38070700005)(6512007)(36756003)(2616005)(66446008)(186003)(38100700002)(44832011)(478600001)(122000001)(6506007)(41300700001)(2906002)(45980500001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?lymoi6UVtBydhlIbF3CvAnWoeqXq?= =?utf-8?q?DovXOCZAY1GZFv/GraqHtnR5Mi/+oUGmeN+/Js5wY9pWxLxTpvlUi3il7Nv44XqJr?= =?utf-8?q?KNNBzjsEKGct+fMV08Hem4E5rmDX1tMNGVGnbcTQUoBDKiLNrifvO8G2LF3MCftWN?= =?utf-8?q?sJLpQmOl71AlMwKJmSPqcBjiOE7z2eXZ4pNcRjE8ujmkesFyK3rDYpBFJZOR/pij3?= =?utf-8?q?6+Ml/OsV2kTIXBChv+z4tCExi3B/wYyZ7GCapPHpsJSFUtWrSPk9IsEsIwZ3RcQOd?= =?utf-8?q?TFSQvcKUO4UAVRZsYh3yeoaSVOS5dWPDaDKlFPxpDEx2G50skC+Pdrn/r0KRB5is4?= =?utf-8?q?xctK0ybcxstGeJ4n2P5KuGHbT6CDMG0EDyHm9oKrvqJsCkiXijMCQKcFia2R+X2kX?= =?utf-8?q?yksAAxcGFKnNEQSIJkfa66dMNCCkSR3Gk8JjRXf+y16SjcE5BM+ZYErDL4JjWiVPt?= =?utf-8?q?jYAvFBqZFsADajFNpqzQYGNraLjpRR3FUOAoiKTLjb7JIrDE8oy5fs0lhm8Sv7oHg?= =?utf-8?q?17Sg6fONlyVdUWnZ/ZSBP8dQ9MtbsvVpGCPsAyGG4u3M4L7ohXCYAsgdX4z85e8JI?= =?utf-8?q?3oDKnw02rm58j3SPXIdVzbmVp8M67T9+vWOmSHdChkmD3X4tcmHfd1t2bWprVBfKS?= =?utf-8?q?OkfIeTLg5nolesMmM4N8Hf8owau51iS5+vDM7enZYQkqW593WIfXYtSY8ZQyQSL5T?= =?utf-8?q?3E8iuiQXXMLdgLnNxY5Sm4HUJPOFAROUxiIMlQfywKtpY9sBg8pZzIcpKyFHB+oZ9?= =?utf-8?q?udiyUqk4aw8EjlWAvAaZi/lMGDe8HOcmT8oF93Mf/zvj5kVFP3DlCA/yWITnG24Kh?= =?utf-8?q?o1TijPTTSt7y3Ddb28vJpH7XvSyXAgMt6gxUP+/pgMeZKBcTybiB0YS2du3DZyOgb?= =?utf-8?q?wEc9J6ifdp83mr2yWmq4EeXYNl/qohLxMm0j8UPQXBWb0Gv7NFS4iz5J+EcW45TAy?= =?utf-8?q?WFe3SX21yABSanukb/3Bpd1Jcfpno20gvbhDEyu7d66vwxfgvXaiBWfKuHJ453GUe?= =?utf-8?q?9I4oHrjHMaZfJU8500/OzjfWEM5jLDpixGAu4N4feg/Z2pLezqo9+lo5NGg9mKFbB?= =?utf-8?q?qCeznakLjmkangzR+KK9XVjIxESyjlZmEf2kjiIpWpnkvWXv7imGMCYWr30x6E1ci?= =?utf-8?q?1Q/Jo6AUhbD65zTLTfRRBFDGK619zSwuhC7miaw9vghTNwAxwwLD7Cu0qXbdRaCGA?= =?utf-8?q?e+V0MR70nplchK3/7m7M3EXmBGxCmny7fwHWP6QiVlJ3w/F4EPWRR4g5Ph2b3yy+K?= =?utf-8?q?5pD4RKsTB5z/DQb3dafuQIexJ3CLPuqd4NhrZGPDRO7JA2bd6v4N6f+OcpNqAL+Y4?= =?utf-8?q?OHALxD70qtWthOrOOA5LkhkYkaALXNGgFAlYMUmEdhDuLqKegJviFv+qBHTProGmN?= =?utf-8?q?UAkNDLAAxXc0k68SDbTc7id2LScizxVhOwwywOOF+WkLWK2knlY1Vv40kQOMKv26k?= =?utf-8?q?f5ABwweRybvYMdCfC44NSoRqLKHDV6eb1giTesVqGvWTzP7T1BriYqiLSkEvCwJK2?= =?utf-8?q?wNSaJtqgDvN08PXcJs5ARULGJ8lBtxTiCQzcHRKJfiyQmOYEq5tQiUs=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <5EBA1DAAA424704D8FD0A6453BAE41DC@namprd10.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH2PR10MB4344.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fa0f3247-9b48-4d1e-7f73-08da749580c2 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2022 14:44:28.5213 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: D5nrQrI8fsIEjjZNouDLtIMUgTN6Mr8kA61a4vP5Qqo7qB0860VX/2RUUQAYcwZlK9DcuRbveJX2n8livz+r1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5594 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-02_08,2022-08-02_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 spamscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208020068 X-Proofpoint-GUID: DqVndkD6F5xuOEYW0ZKJUM_ozdUCyNu1 X-Proofpoint-ORIG-GUID: DqVndkD6F5xuOEYW0ZKJUM_ozdUCyNu1 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Qing Zhao via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Qing Zhao <qing.zhao@oracle.com> Cc: gcc-patches Paul A Clarke via <gcc-patches@gcc.gnu.org> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1740061041603042911?= X-GMAIL-MSGID: =?utf-8?q?1740061041603042911?= |
Series |
Where in C++ module streaming to handle a new bitfield added in "tree_decl_common"
|
|
Commit Message
Qing Zhao
Aug. 2, 2022, 2:44 p.m. UTC
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. ==== ==== (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? Thanks a lot for your help. Qing
Comments
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
On Mon, Aug 15, 2022 at 3:29 PM Nathan Sidwell via Gcc-patches <gcc-patches@gcc.gnu.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? 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 works nicely together with touching just the frontends that want stricter behavior than currently ... > > + > > + /* 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
On 8/15/22 10:03, Richard Biener wrote: > On Mon, Aug 15, 2022 at 3:29 PM Nathan Sidwell via Gcc-patches > <gcc-patches@gcc.gnu.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? > > 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 works > nicely together with touching just the frontends that want stricter behavior > than currently ... Makes sense, but is the comment incomplete? I'm guessing this flag is for FIELD_DECLs /of array type/, and not just any old FIELD_DECL? After all a field of type int is not a flexible array, but presumably doesn't need this flag setting? nathan
On Tue, Aug 16, 2022 at 2:16 PM Nathan Sidwell <nathan@acm.org> wrote: > > On 8/15/22 10:03, Richard Biener wrote: > > On Mon, Aug 15, 2022 at 3:29 PM Nathan Sidwell via Gcc-patches > > <gcc-patches@gcc.gnu.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? > > > > 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 works > > nicely together with touching just the frontends that want stricter behavior > > than currently ... > > Makes sense, but is the comment incomplete? I'm guessing this flag is > for FIELD_DECLs /of array type/, and not just any old FIELD_DECL? After > all a field of type int is not a flexible array, but presumably doesn't > need this flag setting? Yes, the docs should be more complete in tree.h on the actual DECL_NOT_FLEXARRAY definition. Richard. > nathan > > -- > Nathan Sidwell
> 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
> On Aug 16, 2022, at 8:37 AM, Richard Biener <richard.guenther@gmail.com> wrote: > > On Tue, Aug 16, 2022 at 2:16 PM Nathan Sidwell <nathan@acm.org> wrote: >> >> On 8/15/22 10:03, Richard Biener wrote: >>> On Mon, Aug 15, 2022 at 3:29 PM Nathan Sidwell via Gcc-patches >>> <gcc-patches@gcc.gnu.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? >>> >>> 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 works >>> nicely together with touching just the frontends that want stricter behavior >>> than currently ... >> >> Makes sense, but is the comment incomplete? I'm guessing this flag is >> for FIELD_DECLs /of array type/, and not just any old FIELD_DECL? After >> all a field of type int is not a flexible array, but presumably doesn't >> need this flag setting? > > Yes, the docs should be more complete in tree.h on the actual DECL_NOT_FLEXARRAY > definition. Okay, will add more comments in tree.h to make the DECL_NOT_FLEXARRAY more complete. thanks. Qing > > Richard. > >> nathan >> >> -- >> Nathan Sidwell
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; + + /* 13 bits unused. */ /* UID for points-to sets, stable over copying from inlining. */ unsigned int pt_uid;