From patchwork Fri Feb 9 15:54:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Qing Zhao X-Patchwork-Id: 20166 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp946645dyd; Fri, 9 Feb 2024 07:55:20 -0800 (PST) X-Forwarded-Encrypted: i=4; AJvYcCV1kG//gzifknLzLdb2Kp5BFn0uEmrEgVRIEePhYd2HNlUkZM83jZguS6L6V5b9u1Kt9ZVkbzz1yyX40AsonryhjXzCKQ== X-Google-Smtp-Source: AGHT+IHJTsIuZJIniReU9Om0zoGHnWYOxRsu5Pj2KQT8JOn2yCf74QX42Ymn3+98IKIUgTaHmuac X-Received: by 2002:a67:f815:0:b0:46d:2d20:657b with SMTP id l21-20020a67f815000000b0046d2d20657bmr1272527vso.35.1707494120064; Fri, 09 Feb 2024 07:55:20 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1707494120; cv=pass; d=google.com; s=arc-20160816; b=jO9zx5pd1csoZwHmXkQxCuNYJWAXrbA+iHCT47Af2fLJ0odhbP6zlBBOpO9MTRpPlh YY9K+QS77VBsfVrHwuQLJD7SwlnwuG2ZmMXX92JfEcCl342eUqcay/RBJB/6O8+PROHg uNkz45zaRL71Ok5XRjnpTt7T1fgRvdpHH4+0To+VSht4qr5doNZBDtZ/Y4acVcLPLe5G HRLMInN9KH16fm+WiLwnnQIDB8rhBs0zIEsiTjtMrQkKZqB341vTp0UV8HGbTRwQ/St7 i5J7fx9WOHqUbV80P7klicfFDZeduQTeRk8Q7hFaetcOzK/47e5f5wiN4vkTlIhUUEsw 3GxQ== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=UIS7CQBopFhQ94EQWm5wKOaVq+BnX4UJNy8dNvnNgjM=; fh=VpbF4klc3v7gK7T0S9b3M5CQ2+3GeRrZ7YsTw0MRYKU=; b=c60OaUqLWgwFD08+x8AB31VczctZo3ovnTIVeIfLTy2vif09iGduSsa0uErZz9AXZm /5bvu0gUxljgxhJhAWb+throIeffhtwE+S5aYR+03nWh8c6sD7RBoxTlS5ENT2qKAjZM 7cWeIbwn9Uj9mFQJJYPnxh2Dwm/yeTiN4jhUfqj8m5OUeqgFhztL193lvJFAo4DtQQHG NHk/UWuRT21AADH19ltfzobUFrpbQG46XUw5xtu2G6Bie/w0QM3nvw9watyvxokOShDm XJa6AgsIxo40Yjgj0woj82Y6iNR2aGrdUv+bWZHJLfl9u57mwhc2BvJISa1AJTJw74J5 Wkdg==; dara=google.com ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=aCv2Xnh3; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="LV0zfB/R"; arc=pass (i=2); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com X-Forwarded-Encrypted: i=3; AJvYcCVD7U8Fi15YINGA4ODoklAt/9SUt7ZIRvfSpjuMM8IJBwv6Bv1APFAm17sQLb6BTY5baVGCuuPjtUtA2gIH2eSbmGG2Sg== Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id x26-20020a05620a099a00b00783f8df0214si2241266qkx.756.2024.02.09.07.55.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 07:55:20 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=aCv2Xnh3; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="LV0zfB/R"; arc=pass (i=2); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7989E385828F for ; Fri, 9 Feb 2024 15:55:18 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id A69E43858407 for ; Fri, 9 Feb 2024 15:54:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A69E43858407 Authentication-Results: sourceware.org; dmarc=pass (p=none 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 A69E43858407 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1707494067; cv=pass; b=Uq7L5ZNBL9ufY1riJGIMF2yMGcM13er2afrDvPtXJjyOrgStwpbiMW61wQXnhv0q4XxDaLBWTCA7kWy3GgPgM1bBWC21jeaZpdL+TJQD8NH6yqsPnai0e61uRDhhqTal/NJsw0quO8SBXtBURb+HOz0Lwj6w9dGeuOl4AO3CBdM= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1707494067; c=relaxed/simple; bh=tWgFcSjE2wILBEEcxb16l/32wEbKDg31kokruo9WjLE=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=UC3wFU+NDFOvsc1is8LfqiPpCz/F2NcjmbLejrYPCa6h9VIrwWmfKAoQ/+zbOfmRhZGtUjHXo0hb+ItNRnw7E//3JdLi/USXI6NfhFl4ZY666BjVzAoRitDKrA33LqQ7CQ+VD2gorluFsN2HHzbFt1cC4yd7oTYTMFCFHxXR74E= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 419FYjtI027665; Fri, 9 Feb 2024 15:54:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=corp-2023-11-20; bh=UIS7CQBopFhQ94EQWm5wKOaVq+BnX4UJNy8dNvnNgjM=; b=aCv2Xnh3N6hGgzXGMMg0aljkJdSDmoHBjDeYwje6ZuNAa6UcsMpBDl2Uom2ePKhZKe4H wW+8elIFpDmQLn2JQRUMm2RWOE+I0gqNzJ8+cO/FitQfSZyc8yKheO6QlN5Gp2tPil2O jnSEJ4Al34/+ZBCoRcoT7jd2ZVQbAX97J8/lNrGcCYS3AqgBbvXNbJBqouEOhBdV3697 yDna2gou/EMMG8nx6NBvTuKl2Qo5tSXTLu70DW5zuYmLNpecQW5BWzMjbuI0uXr/bJsJ V8t+KbEb5yXjo5Ftc2DlJyCxTncUV14W8Mil3eMArG17Q3MOWTsgDUFG3rIGMxFMygcF bg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w1cdd7s1a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Feb 2024 15:54:23 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 419Fp3gS038324; Fri, 9 Feb 2024 15:54:17 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2101.outbound.protection.outlook.com [104.47.55.101]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3w1bxc4kv3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Feb 2024 15:54:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CqlByBC7zk2NDZfu2xOf8hr+upCJWQnGdaNFXt5cQJG9oCCcQ8tRGbNnyhrtDNo0qTJcvMtyh1YI5qh1u2zj47t3OMbYF7V2f4UKdobrT7fWoL5X+7sUpWh0i855dyDJrc37fg+dw60OdOzy2ri7hXhDaTP4Mn4hOTgKEfvM9iv2KIxK9THH0d8bEbsSREoEii8yr4mch2+oPFEvLZU9ThDUhV00ZESHPCqf4pvyA+rMse7lYst+5jA+VDPlvhiWRMdF3FhcLyqeqhH62F8R24cXJfy3Vsr+EfoP4V6egnErzjqStDWF0mTnwVHn+G7ZA4YsIQNvUjLjjhu+ygZsaA== 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=UIS7CQBopFhQ94EQWm5wKOaVq+BnX4UJNy8dNvnNgjM=; b=MToD/dMKxjb/Ww1JnGCc8tYRk0Yd/I5z+RdSv7tfl+lLU7TkLflSLQ+mHezPZptm13PUBobUfmOp9Gj0lqZdQQ7HuGRoTXQANTOq+Gp9ZL1ypTJJ9OprLcwhD6wFXIEMInFlmLShh2ERXs0HK5J8IpmyXCjf0IePItg5K8FqGzKdWSPZCPXptMLiZgDp+6uMgoyOmdxOyMPghiPZuDPl6sLmffjCkivBxn/7qle/O5ByT51pZeiyq8dWPF90h1LhwkRpBI7vZFmczTlnb88EjrjzM97DFZ5e0ulgfUDaJkdi2iiVFcg8If76+XJEH/fkliz+Xy/5acubcUH1LIjZiA== 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=UIS7CQBopFhQ94EQWm5wKOaVq+BnX4UJNy8dNvnNgjM=; b=LV0zfB/RtPEcNhwfiBDRLSofu2lhSXswtzfxOJ2lxQ4z3AZJnq+reOFoocYLxJD2M6aiDmu8BZ6ZmxBnAUit88k/tAHCsF3UGmBuEFG+KCLTrTn9ApfU5J9blft+o+tuQPuMd9fszDp4QyTOLpG0TJfhAtaYfUbpM8NLuvyKKyE= Received: from CH3PR10MB7957.namprd10.prod.outlook.com (2603:10b6:610:1bf::19) by DS0PR10MB7955.namprd10.prod.outlook.com (2603:10b6:8:1b4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.39; Fri, 9 Feb 2024 15:54:15 +0000 Received: from CH3PR10MB7957.namprd10.prod.outlook.com ([fe80::6234:e7a1:b517:c44]) by CH3PR10MB7957.namprd10.prod.outlook.com ([fe80::6234:e7a1:b517:c44%6]) with mapi id 15.20.7249.037; Fri, 9 Feb 2024 15:54:15 +0000 From: Qing Zhao To: josmyers@redhat.com, richard.guenther@gmail.com, siddhesh@gotplt.org, uecker@tugraz.at, jakub@redhat.com Cc: keescook@chromium.org, isanbard@gmail.com, gcc-patches@gcc.gnu.org, Qing Zhao Subject: [PATCH v5 0/4] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896) Date: Fri, 9 Feb 2024 15:54:07 +0000 Message-Id: <20240209155411.160245-1-qing.zhao@oracle.com> X-Mailer: git-send-email 2.31.1 X-ClientProxiedBy: SN6PR01CA0008.prod.exchangelabs.com (2603:10b6:805:b6::21) To CH3PR10MB7957.namprd10.prod.outlook.com (2603:10b6:610:1bf::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR10MB7957:EE_|DS0PR10MB7955:EE_ X-MS-Office365-Filtering-Correlation-Id: b6f78fe3-63e0-4dc2-6177-08dc29875da4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t8xZX/J8L4RrPG9h6ueR/f4DxB2/bl6KAGPbCfc7xdwZPEzDmvfykU47w9pxkrrFoSqX80fnOAcIGoIgtjPNoDbwCsZVeRZgiZDXSIcwK6atRsiRIeS9Oen2E3ys0BfQH5gTw9TQVMEIWzIX+yajVlgSgJcEocvmb4pEcz5ZYhZyeGZ6X7CKkxPTvn+2U/MkVDMTMyFEIlbki5udtXdU5hD9Zox2ZzpJFARL7AhgmHgnC/fRQLGxxWnS5t+6cJxozBQ2u/4V+G/UbAeflH5O1XOGyh/88k0Qz1S+e6xLDNrBb8wndioZ5HnwhAnndugJbDVda3ygVl7alZau6rpsAfuBsIpek2lFfhL1X+uJKrN/doWCavtBbDFbySR+p/Li5Yc2w3L+yNiIeygKOBo2mSSEH2jDL42vgixUqMNIVF3hgh2hGbn3hrDOTjfuH3kRWvmtY3SoRHy+tFq97S7u/J2YqBpEBnIheSw50UuOoty/b6LcnXTb3GG8eeQjKILM4Y0OvvgS5eehLrZByIXTVKMzX0SJZ1O+XpiNqCU9Xi79/MhURbLh1/vlaz6OdeymKLotbYZ6oJsH3JiNbLlxeg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH3PR10MB7957.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(136003)(366004)(376002)(39860400002)(396003)(230922051799003)(230273577357003)(1800799012)(64100799003)(451199024)(186009)(6506007)(6512007)(6666004)(41300700001)(2906002)(5660300002)(44832011)(8676002)(8936002)(4326008)(36756003)(86362001)(66556008)(316002)(66476007)(66946007)(966005)(6486002)(478600001)(83380400001)(38100700002)(26005)(107886003)(1076003)(2616005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: g8tsIsge/b2JHfgf4XcLyDpSrEe5htRzjxPRuK+cWBuGedvsUA1G0K9h6yUEoDzzpihQnYr5Al2E8dOk2j4thlZUuYiwK0fWn9VHdTWz4J3GI9xTOPJa80BD48KRozGU+G6CkgP35FtcujVtEaP4Ha70Wtw3At2u/U0pCiP4f0NE+XoD2ymJEuHeEW50qcvCmhq+jAg6lb1grSTFIk5fBS1BiETqTgcXltoosW2cQLyDupEihP8m8z8Jo1bGKa/5xbQ671QB69wS4rHm7BkCGqxJgVplOTeHkYGdh9wNtuApltlHeHunyAeFyuI128HsgqdnJ1gntkY5GRC9TwowDm9CrR0BO9MwEk9za+dpNNi+838BcQdLkEP6QyMzYfrTl8MK660BLaBFju7TSBkSuwdNtk068bfZaIgpf8OK1RTBvZWR0jRRdGGvMzT8sdhZY4tPQYaOPxQM4uYtT7q+eCZSY5V4J4FDz4LTJtYpI/tqvsw60+ISM8SUYltDDWpE/9qXTRlfE+vxogeOHyFMO5qjbzhJkC/oQzzfYdAuaY1eKXT1pPaHNFtzCoT/67aKNyoa3VnWYySy4KzbUN9+/ZHVMXJpPJgzbAHKaDRy2kF1LLO3D1HTzH+HaYZSGlsXSUTVaCayMdCVzW8icsxbqlbN/ksjsXUX05DoFXUOf+1I0+yQeEKowbDl8s+nXx6xBKCm2h6eh45AYbl6GcoXdvC/fbNoKkXAfahpBan3DAL+VUGsk1gr39DTufU0xNMe7w8bmqE5b0J8a+xYK0x+mHMKoCSE02RNppuJiGwFPc8V+3rLHkibPHiPD42ztbXIRIumhRdMQXaTZctXxWx6c7aengKpdVd4u2gvPttECsT6nQW7FehKXZAfxE001A2+y8YtQ3scqX0M6l03YTY7rYW+x9X49AoIA1fpk0T8aVHIBQctP6yKDDJWqSpb9v/1GUqgBCokBdPxMh1A9QEfPDzXIITyzhRQ946GVXfKCXamXzmoIw5YIiFZmcUHelbgPp4erlagn0SRcwxyfQRvBFnFN0qptJffZUqNGNb+sQSdc6NqzBIDUvOp3Jvna33Y/fRbTyE4A2q9ZRn5NqoDxzY+ZriHCgQM+ur5KbjIkrgp8Wz+z/iE3t+/OkGYLefp1KVNaMnqSsKkMQqlBmZGxGEjckV4UiQLKEYoN8D1hn1G7pYaIpSJZ5b3j7ysyC73YYUKmwC5rXp31UsWsZB9ixzmnM4zYi5H3k56pRYrpP7useOJ84L0yS0T/QNLFeYMQA8jCzLVcUoHy4FkEQhVP2xjXCjjeggk0i+nmJePTmkgafQSbM61yXaZ4PR3+zs8q/13+0EQSNnpikgH/UHmTk8fY1IPrH7QJB0kwLXACvV2SB3XXS1ME7wAwhJXyXvZbgva4hbwRX9fTM7nuuvjjS85hs2c4MdnCbl0hijw6MdhWtVC8iOpJyC7/k20ocdRHJ2unhT2aEVGFsEbmaIzRf4y2VHNRac5X1Y3Ffpi79zDLZyKzgGfYMlhaWwCQgxzSg5u5fnlHzBkx8rGM0C+SKbeAoJFZwHtFLaLHzmFK8ZKDKtP3hhd9uCP6col3ki4 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: PwTbtxaJj40vP25PaJQSp5xzAo+M6tMw2y8PSsfrtBPIJAtFuHpKH5SrS6jMEElZbDGXthk1WTxHEQhb+zREASZC5DsVBeFEKKaf5zdryph/TQu/Xr9qRC6W10qC/I1TtPJ2o2jt9ElPHMpApH6YChm2MnJrsErWTFmilnQKe5Zl6VeDtvLux96PKGk/ugyrdvnxvKs+zK3/kuFf+3w88oNDrgqM6jan8ScFH2IozhRP832rGszN0w9HhNCudKFDb7A8t4ZwiFytEFtusAE7i2Ay2EhhMijhiVhaarbNzXxZsYvg8LaUSzmgMkciuOPq1VoY1WNUKAxKLFwNCwdzRN4ICYbE0eIMelyYS9KVo7ovCIdxYcTMPXYA5qQd/Ftl1X9+MG0Fs/5xpwu7Erlc26G4tEsA/MUrBXrKTQct3Ty3K+3fP7AmP8IfPuMberuG7LnhD7shytpdGBG8uO26Wjk5G6n7rwibnfDN3B1WnlQ+Vjw3WFOZiKR5X5iVyKXR6Yu9uhchvrDIsUYyDXLlWzDavsuW9Bt7mcb2WMsssfUG4xwK9aOZOVXbaF7sU4WjHPHYPYIYnitloYUAwW0gcVTm+UCMFdnVlMp7axkTwoI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6f78fe3-63e0-4dc2-6177-08dc29875da4 X-MS-Exchange-CrossTenant-AuthSource: CH3PR10MB7957.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2024 15:54:14.9327 (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: b2A/LCgxKzVT8EQwOWgatppk72zM97kC36I2Rs6ssXexGzc5M/Q2xGsjt1fYzXqwoQO4E+q0gMj5glrulrk/Tw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7955 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-09_13,2024-02-08_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402090118 X-Proofpoint-GUID: J5O2M8zDxR5H1dSxduBPRFQe4Lv44AiS X-Proofpoint-ORIG-GUID: J5O2M8zDxR5H1dSxduBPRFQe4Lv44AiS X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, MIME_CHARSET_FARAWAY, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790437354475394296 X-GMAIL-MSGID: 1790437354475394296 Hi, This is the 5th version of the patch. compare with the 4th version, the major difference are: 1. Change the return type of the routine .ACCESS_WITH_SIZE FROM: Pointer to the type of the element of the flexible array; TO: Pointer to the type of the flexible array; And then wrap the call with an indirection reference. 2. Adjust all other parts with this change, (this will simplify the bound sanitizer instrument); 3. Add the fixes to the kernel building failures, which include: A. The operator “typeof” cannot return correct type for a->array; B. The operator “&” cannot return correct address for a->array; 4. Correctly handle the case when the value of “counted-by” is zero or negative as following 4.1. Update the counted-by doc with the following: When the counted-by field is assigned a negative integer value, the compiler will treat the value as zero. 4.2. Adjust __bdos and array bound sanitizer to handle correctly when “counted-by” is zero. It based on the following proposal: https://gcc.gnu.org/pipermail/gcc-patches/2023-November/635884.html Represent the missing dependence for the "counted_by" attribute and its consumers ******The summary of the proposal is: * Add a new internal function ".ACCESS_WITH_SIZE" to carry the size information for every reference to a FAM field; * In C FE, Replace every reference to a FAM field whose TYPE has the "counted_by" attribute with the new internal function ".ACCESS_WITH_SIZE"; * In every consumer of the size information, for example, BDOS or array bound 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 reference to the FAM field; * Some adjustment to ipa alias analysis, and other SSA passes to mitigate the impact to the optimizer and code generation. ******The new internal function .ACCESS_WITH_SIZE (REF_TO_OBJ, REF_TO_SIZE, CLASS_OF_SIZE, TYPE_OF_SIZE, ACCESS_MODE) INTERNAL_FN (ACCESS_WITH_SIZE, ECF_LEAF | ECF_NOTHROW, NULL) which returns the "REF_TO_OBJ" same as the 1st argument; 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 pointer type. The call to .ACCESS_WITH_SIZE is wrapped with an INDIRECT_REF, whose type is the original imcomplete array type. 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 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 represents 0: unknown; 1: the number of the elements of the object type; 2: the number of bytes; 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 ****** The Patch sets included: 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; 2. Convert "counted_by" attribute to/from .ACCESS_WITH_SIZE. which includes: * The definition of the new internal function .ACCESS_WITH_SIZE in internal-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_constant_valid_p_1 and output_constant in varasm.cc to include calls to .ACCESS_WITH_SIZE. 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. * 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-ssa-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_SIZE 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.cc) * 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) 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. 4 Use the .ACCESS_WITH_SIZE in bound sanitizer which includes: * Instrument array_ref with a call to .ACCESS_WITH_SIZE for bound sanitizer. * when the size is a negative integer, treat it as zero. * testing cases. ******Remaining works: 5 Improve __bdos to use the counted_by info in whole-object size for the structure with FAM. 6 Emit warnings when the user breaks the requirments for the new counted_by attribute compilation time: -Wcounted-by run time: -fsanitizer=counted-by * The initialization to the size field should be done before the first reference to the FAM field. * the array has at least # of elements specified by the size field all the time during the program. I have bootstrapped and regression tested on both x86 and aarch64, no issue. Let me know your comments. thanks. Qing