From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 1897E385840D for ; Tue, 23 Apr 2024 19:56:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1897E385840D Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1897E385840D Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1713902193; cv=pass; b=snipqxRPNMZHmUeMIF8ObUJBeDwy3+mD+QfbzxC27gmyWFS1/wab3wm4meFlB6SFXpjugJVY57k365yf2mokCAxCsa8WNo0op5YyHfYJr5cM3R4rHr95YYjjrHeV2wR8iFMW+zmh4l2GIMyHpk8LmwJfH/5P0rVShn5fvPjIs3I= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1713902193; c=relaxed/simple; bh=EowvYjBJYhInbjA4F1B+x40L3d+Cz8gysDRi2Lifzm8=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=TKUrRiJUSdtQATEiyK4jZR/foHsvW6OCQ44wseqm0n3+8NTY6kt/zdT8g+abR7tp214uWDotbaTzIrSBV+xcpWtYLsVqYzMlojQEc5uCeo0kTnFjW51nMCu7xUrZ+s920bPlHt34a1nSJXKeicK1O0zpubxOD7x8Omd2KkJeN40= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43NJdRLq026837; Tue, 23 Apr 2024 19:56:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=corp-2023-11-20; bh=1oFiw4a4z3I2FyNcbrBnHX8dt4LzoKQ2o6UG2wzy8HI=; b=P1nrhXF5ByfceAqpmgXd+jiW8+OowowupfbYxWRtV7zPJsT/ASw+g1f6J8gXA8ZzGWuP 3YlH4h4sVwzz7aluCaU8dUUfu6Aetx7HxQ8IKZ30kccRYzZRF3tUMXT76N5opvLfkbxS KS4bJFFvaS+hTGymkhhpl55NYIqKuYkRVTlqZus+Z3+aix00Q4v0YxcGiJ4wqKXXc3UN JQWqbTGC2mXlO24vCzDz853RnY8NWhGkzagdTy5AaD6SkO01+R8NpAHzqeESNscm9X1Z iS36U34l3cQuZtq1UOq9/U+wKlRaHmw6S0PRHRHM/tMUaOs6rdNLdoI5upkxbVpdLndz 1A== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xm44ex772-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 23 Apr 2024 19:56:29 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 43NIYYcc001709; Tue, 23 Apr 2024 19:56:28 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3xm458a52u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 23 Apr 2024 19:56:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W8NPi+vj1rykSdj7rdA2OQ3ZqsTPnYT2B3bfpvQroetwczxs11sUvCRxf+lEVy4JY6b7w/nsLtzCKBzNubhrnBl2xBugrMTgraQ5Gfbc1JDib2usDFXY6HGXzmh2gw012qweVH6sGL7Ti0O0nhOCFI1cPLubf12rrSZqccFOhEFfdV4WyJCVTrB7JNa3jmRs8mCDhdt/cgc+85BdIDygqROLelR8L5hGsyrY8tEw+tcT+KjEBImQXkjZ4oodDmwnqpE3Br1bOeZwEsow5kAUTmBwVU9nb8I8izgbGUZfuM7c2tiDwADqy8BT1bVfaVs4a9kB7+SRXUvMj8XW2r36sQ== 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=1oFiw4a4z3I2FyNcbrBnHX8dt4LzoKQ2o6UG2wzy8HI=; b=Hit/qAgDvump6magS3oGZJBqCTxtkXovH9WIUIcHGwegzYRPnspWUq+/kQ8/bNh8REqwroyoi/Gx0dqfBb0PVZ0rqtLtt6ueJl8aAHlm2S5C17U2QxPctsfdbyoSEbykI0FIpngRPhzELHYIfbe0t99MLepx1fHwn6Nop6QSmaSSy7QJURFMI1eUJ12XNuEoP/etWkLRH0vYpq4jBzuMapo4RQgUtXvzJAaVMXTbB5m9ug199ZgaIVUBFef9CogWn6ZsqJurwC8O9Cr9mE9GXN0KVyDiUARx6JfIF0a0JlnyBeBuD1+UHF0dAfZx04vAsXqq/Qshz7kSY0L1mI8P0w== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1oFiw4a4z3I2FyNcbrBnHX8dt4LzoKQ2o6UG2wzy8HI=; b=HKOVAL1eUypjf0muzxPz2wJW2UodsC1RFf/qMmEna/uLZewcxPeDDcsj3gei+8EkS8jE8sowpjqeGoJ7oci8wh+szIOl2dWq0h+uGJCbyBYtInf38N+eSqiUZ5SAuhqEWn9Q93NtCU1DuCGK9T4WJJewfKFvojEf5rLOAVFJuIM= Received: from CY8PR10MB6538.namprd10.prod.outlook.com (2603:10b6:930:5a::17) by CY5PR10MB6261.namprd10.prod.outlook.com (2603:10b6:930:43::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Tue, 23 Apr 2024 19:56:26 +0000 Received: from CY8PR10MB6538.namprd10.prod.outlook.com ([fe80::2dae:7852:9563:b4bc]) by CY8PR10MB6538.namprd10.prod.outlook.com ([fe80::2dae:7852:9563:b4bc%6]) with mapi id 15.20.7472.044; Tue, 23 Apr 2024 19:56:26 +0000 From: Qing Zhao To: Richard Biener , Siddhesh Poyarekar CC: Joseph Myers , "gcc-patches@gcc.gnu.org" , "isanbard@gmail.com" , Kees Cook , "uecker@tugraz.at" Subject: Re: [PATCH v9 0/5] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896) Thread-Topic: [PATCH v9 0/5] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896) Thread-Index: AQHajODzBJ2yZVu8jkScUH4cztMncrF2VtUA Date: Tue, 23 Apr 2024 19:56:26 +0000 Message-ID: <489A3D87-437E-494E-9200-8A0B28EB6AE2@oracle.com> References: <20240412135430.4122328-1-qing.zhao@oracle.com> In-Reply-To: <20240412135430.4122328-1-qing.zhao@oracle.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Apple Mail (2.3774.500.171.1.1) x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CY8PR10MB6538:EE_|CY5PR10MB6261:EE_ x-ms-office365-filtering-correlation-id: 782064a8-ef41-4329-0ccd-08dc63cf7582 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: =?us-ascii?Q?RaaPjIP35q1W9B5UipU+Ri93xvmL+g+gb01fXkF2Je6V7ef7EsaDQ+sQI7t7?= =?us-ascii?Q?o/QcnsSbl1DyI8yY6mGfOhVhr6yFpdAvadYh0Q7jO4otITkKWdetrcjDf/hq?= =?us-ascii?Q?kyLnsqyKjNiws0OxnduWhRv9OGpqq+tr7Fw75hIho0vGTnssDB9/8VdB6ea6?= =?us-ascii?Q?cwaJ8ZJVr9gurtZ/j30o2rmkTASWOhiP4/CFcG7ezakbNliH6IMWHu4kc3dx?= =?us-ascii?Q?BS1+KRUvy7JPkHSeQotL6da//KlOGu6Eyzk4ziTFBBTmrDfPAEvVSiE74iGn?= =?us-ascii?Q?O+w0NxZkh1Puaut2au18JBirDeH62Cybz3reO3Xb5gCyI5pjq26OvgukRMla?= =?us-ascii?Q?d5NYz1o7zyrqjM/hoMRaviOpT4+8QsaFfOs2FKkAT/0wVCwPUZBtqsa2wDhf?= =?us-ascii?Q?7uZue+8vWTBVX0r3Fx09rvM8nxlFYpg/3hYPY+MSDK9gCMaHJccbjeYOwci8?= =?us-ascii?Q?gw5ys03pPJAQe9t2GgiOWMtDZLk5HlKXpvh+lUVB6cDuo1LuLs1kpIJ4hcxP?= =?us-ascii?Q?4N/V4phhf101z5fmk8LKHM1wkfeH1h1RDXp1qZcy804T3BrYPQmFj0gHwGcF?= =?us-ascii?Q?aO39jCoKii2liqcmCWZJz8eefNE70SNV7Ga91WfFQU5EAaC4z0bGXUAwIwj1?= =?us-ascii?Q?Ttj474r+RwGwAQCcQ7jlPXytGJ9qBSIgbcT4GxoekQdqHpE3G4A6nwW90OFm?= =?us-ascii?Q?WKXz3bnnmJt8IMLL3+ATbTBNthRuMmNdo+rJterVDOML0xaywr4Myik5etQC?= =?us-ascii?Q?CEiCBu9rqrTE4fBsXuRg+ONSHpBIbxyrNuwpmOMKlVa8dd8CvFr8cMuV6Ihf?= =?us-ascii?Q?eIENcAhTudjM/Aw1Z/8a47CSWc5Jepbbl0tpEXpY6eik3NdReKdg8A5sf8WM?= =?us-ascii?Q?ADMeSW4mAccaMX5g7zPHx6zYIyQ22v/Z8eV/fDAXYb8aXxuOm+leacQY+YvM?= =?us-ascii?Q?eGzwbQB3q8CzK7+8iGHXW0j6Ge4WfM4sGaMpSS2irMDLKuuACvHtcPVGbgas?= =?us-ascii?Q?VQLutBKLJ46EqSj1HZBz3RQ1gdO3gqm08tfYARpJLkcDLXlXn+c5uwEn20jm?= =?us-ascii?Q?jJ3rtPQ+bowbPSSDMRmVe9S47n/6H3e4lFGG05+machM4SMnWhzpXKhsApyp?= =?us-ascii?Q?0koOZvr82iIZ556rijwKeJGLqz6HOnpSsMhx+QmhVo0mBV/1ZdAuCElk6qS0?= =?us-ascii?Q?nz/Gbih0boL7Pqb4L0xCqM0xPHqJ/87QG4yZXUOHPweHaqhBALtD6fWqXD2h?= =?us-ascii?Q?cQywRrxUvWjgNAQQBMDa4LgwJlTjCIFFrEmXJn1mEfQvx6y30vWWCCWvPqeH?= =?us-ascii?Q?+gXq5tZ4YIBSBNJxp5QfAyEWKuWsgZ7kGvd7NxbL7pQx7A=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY8PR10MB6538.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(376005)(366007)(38070700009);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?TSZidQNic3nhZcFxrZuxx321gHN4baU6WHzmRZOYVTV7sKgaN53BbJKrecCM?= =?us-ascii?Q?TJtH7j7/A4gEnEy6Y5B9RIGcvUtonDo96E21uQHaxBYKTS8eQsOlh91l7oYW?= =?us-ascii?Q?6O2a0W5mRSFNQ4c5EVR5Gt5e5n10e2W/b6Qr2ubLixd77b20m2i8FIuEimZl?= =?us-ascii?Q?lI4IrJOAJgY24Gofjn+1zVPod3xMX3E/CsNkpKO2eelPZhfP46vStazaR+ps?= =?us-ascii?Q?8/ISpjlBGp1Zbg52WKR7dP4JzIU/QTjHdse/2viTyMHXRuPLAGltKr0GMz9b?= =?us-ascii?Q?O6GRavAOuvbwcTWhknfwY9RntKGtNhtrhS0Ap0nbHPRdYFOA6VwStEtlb+6L?= =?us-ascii?Q?jTsFUObv6yk1Fedv6e6z0twpjgQfcpLaeja7aMqIOxWHKsXbDFPOlk7YK7Tk?= =?us-ascii?Q?eL99kg2NQqwYTFXXUdRJfc5Z4NJMR/UDnS3dbMXOCPqQqSwFGcHmy2eYePrG?= =?us-ascii?Q?8D60sW1t6UpDGyoGqcAowK2UPuD/IFTt9X4oFpDVpkOo43WSrtXyuytnE5Q8?= =?us-ascii?Q?Vho45eHHfoJx3IxRgLJ4vPIjhy30I9dRzTHjcuCspY9HX+aGqLlFuT5c696T?= =?us-ascii?Q?akWudAhNumGzFw92DenHxNHvFjNVVr2EZpDXFOCO9Gll+AFAfMIeqQ/5e5tx?= =?us-ascii?Q?EfPvwNpoVPxTLVQ8uED4jzOZJ5fhTxDM3o6SXDBAUYuFlr/4wb3KYMETqD1M?= =?us-ascii?Q?2/0MH99ySSBteDVI4OSmG0Ht8UjxxmYB72zHi61M/BafRKlzB5tBQR6hRu9S?= =?us-ascii?Q?fv446vc4L47RAjuNlGeQCeBGM+r3v2c5h0+wdOGhH1zgwvomttCTtUFmGjOV?= =?us-ascii?Q?JgX9UZyDIPL0gt72PgKaiLjgeLLAW1Be4K3JRan+3Ug/YJU8fX8OTRBymDDf?= =?us-ascii?Q?guT+v3aFj4SVbtg4WxfadHMqZwKmv9Yoe/LR6H/Um7VTcLiTyRqjxjYx2cCF?= =?us-ascii?Q?vmULHxMT2u8K2jnBgJJzHawAOgrnDCaUYuSlHcc/Qec226RUxTRdkqUT9P94?= =?us-ascii?Q?8XoeoZGXVC0dTWCXzPMi+tsatWNU7Uty+mJ9//GiGJulIRr8TGfC7tdkR4Aq?= =?us-ascii?Q?GnRp2Sl5HIgWPR2ywcJpplycSTCALWEIrI85j91yBbsIJoTtZ7HssLZuYZKE?= =?us-ascii?Q?sAvOTiwvLNwzq4NfiUVQQd5JB78H9fgnHIMJRl3PlCCk4s1S8hJPaxVpqVOh?= =?us-ascii?Q?7AvMhnECXSPpWdK7kTnwN9YqQxe6Mvn7t1FyD7pqSn6DePZBW6gBlhJ9s8Yk?= =?us-ascii?Q?rFlmOfxFUhN8iufICbsRicglAf246i+CoSlaQbV9J2YiJ0EaNCEVpF5uua94?= =?us-ascii?Q?VB0izgkHQCBctImMv7Mp4tBSpXTz817k1TR7j7SRsCZdQjkU9LnkWO7Z8y2U?= =?us-ascii?Q?YC8vzEDltcRswD5fjfua5MsPKe3F0EBC8cLUSksCs7TRGCOT4uMZFnMKopio?= =?us-ascii?Q?rsKmrJoK5IcMwWPUYEaKQPfzJkGPpuLeUtvHuo5RMhdou7Xph49XEVwhgNoK?= =?us-ascii?Q?fso8GTel3EhA4ijfnNPesOjdgoInjDw8iZJQ2ZbrOvM/m3LoQQIbLJhh7dMW?= =?us-ascii?Q?tFjvLKYWaxZVlOA6mzEQCfaikqolmT53PdAGYRdS+36jcd5IV+yXPki4Vuq8?= =?us-ascii?Q?aw=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Rsur8V5n+Iyr1s8xu18sz9uPPhQbTCt5La69LWrZ/VKNOeYLDbLt1ocl0XqI9Mse0vQk2T5T5j51VDfjc1j5Fu3+nnLlhoXryz/P/7+C8YTUUQ5/q6Nb0saOZjjawD4cY6RG2cJGwdvYZuy2ayPN6s9mx0UZAmxPi/VGvNGcllbJkr6NdPfI8iufN1tfQR9sRmIoip5IIjPV1KZmRJpU0ki10Kx0eTh7RoAhl4Pfr83QNUfmWUFD4VsfN099j68eLGYLuYZGZ78oX0wQGtCKo61lEM5vjIuwE1+RZLMsrWxL0DTba9LM+sRY6xQWmJDCx73jdRi6tgdFMUleMC+W1ItjQCNnk47sjC0jIdOdvitU8f+JjOCzlSmTTmx4JEmp7Ft5KNEH64vCjDLi0/VH7SQkWSFXQXC8b9rJwneVyjlRPIx/M5q6Yocs5kXghgKPxolAz+kmj25kvEXVAcFosViEC3j7kXEkc/JieuAiB5TWom+FJzezJtZkE07zRKHmvlA6HVKv+dtStY2OhqWtkuCADaIK+oR0FVRHE+Z2c3fY+ItaTngcg8/8S2YEcp7yGg8XMcrsJTT6ZEFYJkn9iAdx0Sz9gTC3gzPAzcivDS8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY8PR10MB6538.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 782064a8-ef41-4329-0ccd-08dc63cf7582 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2024 19:56:26.0543 (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: xZDFbmZ2fTJQHIHaH7/9l0d6o5Ak0tzZdEnwAh1BqtsTd/+8Dg7X3GseeDs21pjq+o4pcLft0ReHp1kOH59LKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR10MB6261 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-23_16,2024-04-23_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 malwarescore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404230047 X-Proofpoint-ORIG-GUID: Jc1iVoBw3Pbyu9s4M_ZLkr3vKGU_PCy0 X-Proofpoint-GUID: Jc1iVoBw3Pbyu9s4M_ZLkr3vKGU_PCy0 X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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 List-Id: Ping for the middle-end change approval. And an update on the status of the patch set: ******Approval status: All C FE changes have been approved. ******Review status: All Middle-end changes have been reviewed by Sid, no remaining issue.=20 Okay for GCC15?=20 thanks. Qing > On Apr 12, 2024, at 09:54, Qing Zhao wrote: >=20 > Hi, >=20 > This is the 9th version of the patch. >=20 > Compare with the 8th version, the difference are: >=20 > updates per Joseph's comments: >=20 > 1. in C FE, add checking for counted_by attribute for the new multiple de= finitions of the same tag for C23 in the routine "tagged_types_tu_compatibl= e_p". > Add a new testing case flex-array-counted-by-8.c for this.=20 > This is for Patch 1; >=20 > 2. two minor typo fixes in c-typeck.cc.=20 > This is for Patch 2; >=20 > Approval status: >=20 > Patch 2's C FE change has been approved with minor typo fixes (the abov= e 2); > Patch 4 has been approved;=20 > Patch 5's C FE change has been approved; >=20 > Review status: >=20 > Patch 3, Patch 2 and Patch 5's Middle-end change have been review by Si= d, No issue. >=20 > More review needed: >=20 > Patch 1's new change to C FE (the above 1); > Patch 2, 3 and 5's middle-end change need to be approved =20 >=20 > The 8th version is here: > https://gcc.gnu.org/pipermail/gcc-patches/2024-March/648559.html > https://gcc.gnu.org/pipermail/gcc-patches/2024-March/648560.html > https://gcc.gnu.org/pipermail/gcc-patches/2024-March/648561.html > https://gcc.gnu.org/pipermail/gcc-patches/2024-March/648562.html > https://gcc.gnu.org/pipermail/gcc-patches/2024-March/648563.html >=20 > It based on the following original proposal: >=20 > https://gcc.gnu.org/pipermail/gcc-patches/2023-November/635884.html > Represent the missing dependence for the "counted_by" attribute and its c= onsumers >=20 > ******The summary of the proposal is: >=20 > * Add a new internal function ".ACCESS_WITH_SIZE" to carry the size infor= mation for every reference to a FAM field; > * In C FE, Replace every reference to a FAM field whose TYPE has the "cou= nted_by" attribute with the new internal function ".ACCESS_WITH_SIZE"; > * In every consumer of the size information, for example, BDOS or array b= ound sanitizer, query the size information or ACCESS_MODE information from = the new internal function; > * When expansing to RTL, replace the internal function with the actual re= ference to the FAM field; > * Some adjustment to ipa alias analysis, and other SSA passes to mitigate= the impact to the optimizer and code generation. >=20 >=20 > ******The new internal function >=20 > .ACCESS_WITH_SIZE (REF_TO_OBJ, REF_TO_SIZE, CLASS_OF_SIZE, TYPE_OF_SIZE,= ACCESS_MODE, TYPE_OF_REF) >=20 > INTERNAL_FN (ACCESS_WITH_SIZE, ECF_LEAF | ECF_NOTHROW, NULL) >=20 > which returns the "REF_TO_OBJ" same as the 1st argument; >=20 > Both the return type and the type of the first argument of this function = have been converted from the incomplete array type to the corresponding poi= nter type. >=20 > The call to .ACCESS_WITH_SIZE is wrapped with an INDIRECT_REF, whose type= is the original imcomplete array type. >=20 > Please see the following link for why: > https://gcc.gnu.org/pipermail/gcc-patches/2023-November/638793.html > https://gcc.gnu.org/pipermail/gcc-patches/2023-December/639605.html >=20 > 1st argument "REF_TO_OBJ": The reference to the object; > 2nd argument "REF_TO_SIZE": The reference to the size of the object, > 3rd argument "CLASS_OF_SIZE": The size referenced by the REF_TO_SIZE repr= esents > 0: the number of bytes; > 1: the number of the elements of the object type; > 4th argument "TYPE_OF_SIZE": A constant 0 with the TYPE of the object > refed by REF_TO_SIZE > 5th argument "ACCESS_MODE": > -1: Unknown access semantics > 0: none > 1: read_only > 2: write_only > 3: read_write > 6th argument "TYPE_OF_REF": A constant 0 with the pointer TYPE to > to the original flexible array type. >=20 > ****** The Patch sets included: >=20 > 1. Provide counted_by attribute to flexible array member field; > which includes: > * "counted_by" attribute documentation; > * C FE handling of the new attribute; > syntax checking, error reporting; > * testing cases; >=20 > 2. Convert "counted_by" attribute to/from .ACCESS_WITH_SIZE. > which includes: > * The definition of the new internal function .ACCESS_WITH_SIZE in i= nternal-fn.def. > * C FE converts every reference to a FAM with "counted_by" attribute= to a call to the internal function .ACCESS_WITH_SIZE. > (build_component_ref in c_typeck.cc) > This includes the case when the object is statically allocated and= initialized. > In order to make this working, we should update initializer_consta= nt_valid_p_1 and output_constant in varasm.cc to include calls to .ACCESS_W= ITH_SIZE. >=20 > However, for the reference inside "offsetof", ignore the "counted_= by" attribute since it's not useful at all. (c_parser_postfix_expression in= c/c-parser.cc) > In addtion to "offsetof", for the reference inside operator "typeof" and > "alignof", we ignore counted_by attribute too. > When building ADDR_EXPR for the .ACCESS_WITH_SIZE in C FE, > replace the call with its first argument. >=20 > * Convert every call to .ACCESS_WITH_SIZE to its first argument. > (expand_ACCESS_WITH_SIZE in internal-fn.cc) > * adjust alias analysis to exclude the new internal from clobbering = anything. > (ref_maybe_used_by_call_p_1 and call_may_clobber_ref_p_1 in tree-s= sa-alias.cc) > * adjust dead code elimination to eliminate the call to .ACCESS_WITH= _SIZE when > it's LHS is eliminated as dead code. > (eliminate_unnecessary_stmts in tree-ssa-dce.cc) > * Provide the utility routines to check the call is .ACCESS_WITH_SIZ= E and > get the reference from the call to .ACCESS_WITH_SIZE. > (is_access_with_size_p and get_ref_from_access_with_size in tree.c= c) > * testing cases. (for offsetof, static initialization, generation of= calls to > .ACCESS_WITH_SIZE, code runs correctly after calls to .ACCESS_WITH= _SIZE are > converted back) >=20 > 3. Use the .ACCESS_WITH_SIZE in builtin object size (sub-object only) > which includes: > * use the size info of the .ACCESS_WITH_SIZE for sub-object. > * when the size is a negative integer, treat it as zero. > * testing cases.=20 >=20 > 4 Use the .ACCESS_WITH_SIZE in bound sanitizer > which includes: > * Instrument array_ref with a call to .ACCESS_WITH_SIZE for bound sa= nitizer. > * when the size is a negative integer, treat it as zero. > * testing cases.=20 >=20 > 5. Add the 6th argument to .ACCESS_WITH_SIZE to carry the TYPE of the fle= xible array. > which includes: > * Add the 6th argument to .ACCESS_WITH_SIZE. > * use the type of the 6th argument of the routine in tree-object-siz= e.cc > * testing case. >=20 > ******Remaining works:=20 >=20 > 6 Improve __bdos to use the counted_by info in whole-object size for the= structure with FAM. > 7 Emit warnings when the user breaks the requirments for the new counted= _by attribute > compilation time: -Wcounted-by > run time: -fsanitizer=3Dcounted-by > * The initialization to the size field should be done before the fir= st reference to the FAM field. > * the array has at least # of elements specified by the size field a= ll the time during the program. >=20 > I have bootstrapped and regression tested on both x86 and aarch64, no iss= ue. >=20 > Let me know your comments. >=20 > thanks. >=20 > Qing