From patchwork Wed Jan 24 00:29:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qing Zhao X-Patchwork-Id: 19357 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp688842dyi; Tue, 23 Jan 2024 16:31:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IEQaEUzRe1spOPr8ua49TLCVNvBdHSBRHJqIvIN5LZnyqEUw9o+EmMlPFILJ1VhvHHyN7Nq X-Received: by 2002:ad4:4ea7:0:b0:686:ad66:3551 with SMTP id ed7-20020ad44ea7000000b00686ad663551mr287175qvb.47.1706056297653; Tue, 23 Jan 2024 16:31:37 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1706056297; cv=pass; d=google.com; s=arc-20160816; b=OoRnIH3hLapu+cURppD7hDFHS/q3eIce/2OU9A/ntn6OL3Vpu4KH8BijAN55mB9Zpn EEueGELMMWCXJ7uvZgWbsUQQCUMK9phqeAV37xyKPHUoaCrvF3bJbiT9C2nK5geZWsEN PN1d7jvP/8EDCoHQtByMKZJ8VgdihYKiM2bwb1PQGZWpseCQ9pOTULdaPfuKcnyLRj+n wgJuCW1CuiPLDsTwDJQ3HN2I0Rx76AZiswvlmiwtOtdTwj9VXW7JreFPcpbJ1f+PP2di QEDxzd+oy5+r/pVquUlYefhRrZdQhQoA4Wd6ibnwYG3X+geYck+9JhVFcMNso156WnTT io0w== 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=HNw8ngmeKNDAHiKSAVcvOmPueUzFh20MEqpxd1AT8w8=; fh=CJ4gvMxvfPB25iGbJgp7lolaZhkZrM7MYpkDmawi2Is=; b=VzQgSbSadUC/AXZyPFo8ibM7JqCyEKEh5qC9t/HtowR/wOOiM5nGN2NZzH1FSlIuXC KL/dEFrCgV+FAgrc0sPuAKpWZ3qhpFdFbER632YDD0k9meycTWFvi6Kl/AocrX67EMle 4zxfpzWYrdbfVno6EyZcrXzFLCRZpaBOPsU0n+hlJOsFWQ2cDsziP6DyK8A/KPLLPn4t Ghs8dCr8nMpaQx5RScfoUTZS8JFCeMxmRlZbI+p1DHpQGJokaL8DvoQ0zS8/7Yn+CG1o L+9j7P9qx37z2ljD+RBNEVuyoohXQAaZnfPrxcUe3dbjUg98Eu97CluGxjxY9IkJ2Zy7 eM4Q== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=iAx+qh7R; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=E7Qg5tfV; arc=pass (i=2); 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=oracle.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id b18-20020a0cf052000000b0068181e87595si8982771qvl.362.2024.01.23.16.31.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 16:31:37 -0800 (PST) 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=@oracle.com header.s=corp-2023-11-20 header.b=iAx+qh7R; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=E7Qg5tfV; arc=pass (i=2); 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=oracle.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 42DD13861837 for ; Wed, 24 Jan 2024 00:31:37 +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 47798385E012 for ; Wed, 24 Jan 2024 00:30:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 47798385E012 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 47798385E012 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=1706056216; cv=pass; b=fazior5Tm+uCfQNXTcHLfC0m1bU8Smd3KTZpzLKqyVrPc4YUaIiCUHKtLjsogtZzqhbVybzi5hehFCJg2mldkzRw4JmlIJxawfJ/hU6bnUdJ5hSVJxE3hHmrur4eR9+3f44/XBKUttGlR48VgwgjARGnXCdI83mrRyyEvyp6rwk= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1706056216; c=relaxed/simple; bh=6X9NFuzfpOOm4hBAKbeyc3S0sqbnX3HjQCObh9M3wZg=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=bPXUF19gTgr1Tp6EqgXtfq/QpkdLa1wCNBbc+H2SQDqFCwEAP9OLREV7EyoBxVoNBOxe79bXBzBWs4C9h3wqLKCBM0lxHn/0j5u5OBF8FL2stRne2huU/x0MH+W3Khbhh/dPXXjr93MiGC0GVgU95qEv96HIF8YA51YJS6BI+C4= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 40NMrmDB025190; Wed, 24 Jan 2024 00:30:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=HNw8ngmeKNDAHiKSAVcvOmPueUzFh20MEqpxd1AT8w8=; b=iAx+qh7RxaYFqhPqRX5xmjK1NqyH9GQ4ZlCMeCxiXjy93KMiZjT3xeH5ialLKtPVmnny i35OVAU6lbrSngZt66vMl90btqeIDRIX8EJNDE6467xRa2tjf9Z3teXfzEBHgJkLF/Pp eb0fpqk97RPY6Df87HlpXM4INaVKhHvFYy3t2VJibKf+WZtsH+k6Ge0RzUsOu48c+jwr tPWxVBKzWu7Cd4HfsVlnD9rF9mvmTaTk9ZQvqE0tty5eqzRwkqEEEAWZAjBD1HHJjVNf Lg92afWfamMtlKiKoT3baWpCMMxPVmyu1o31G8UUEjyYJzuGUh5PYRsJKlfsmSgWfGhT gQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3vr7abyu1y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Jan 2024 00:30:11 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 40NMt6wW014361; Wed, 24 Jan 2024 00:30:10 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3vs3724has-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Jan 2024 00:30:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LRPuSHqpLXUU7NbDDfNG+WP/oSTpe3CnswYi99nCZXIUXUa1WWh59UEUPU94JZ/vQjLOsAWFaRNZorJ+DXs5bgXM/Mks2YUTNzdcd8A9nHsSkzqar7zpn1XLfeJ6n1Wz5890qsn92peXrFJiLpdM1HhwYsSitAbWYyjf010gognvG+7EUAcTIwNQP8U5DdOQFzp9I0M3cQeu3B7tYSmpZ1nBaa3N559JEY8YnaA7CgXwQFzyv4PoDuNY1sNccmSpU2hOXQ50HW7k6UJJdHBndhHXQeXOs+XxZAFto/fPuOrnKwcB5VXfC+KNkHs6l9RfIxalfvorzOvHG4J17n5Vsw== 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=HNw8ngmeKNDAHiKSAVcvOmPueUzFh20MEqpxd1AT8w8=; b=BtRzbBpvhlTk6QbqHXiCwd6dpfvp4rrQMYw/MxqTTv+728D1eUK/UnoddXqhv7I/aQygIRVWecG47DYqQIM69T2Yx5cBtMCMQ+89m36MUOvpI95M5rvMx8bBdgHRtXWQpv2ec2JF8DxtodS4B5ti4IwrkKVfcd2RPVOk1oFLgW0opiPTtbr9P8B24HVF+HqfBTVxQOSn9xa3DS6+eqZ1U7PdQnSWyeX4lF4LrEiZI4LzRl1vp/YGGkgXPM9JepuyM2oIy4fl/Qvh3toI5a+QKF4bz0m/J9BAkXTvbc4Bkl3GUKmqM768uNjEsG7yEsRBxIJaeNYK1omMnF3JjMsl8g== 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=HNw8ngmeKNDAHiKSAVcvOmPueUzFh20MEqpxd1AT8w8=; b=E7Qg5tfVitX4KHkkZdhlcci5/sjOZByebseTDI5NPOA7PrZD/rObzLaIw4dDLS90BgX2rvKl2wYruGp52Ax4l9wyHyw3YYvlenkrBREGUp2ZPysClX/9ZR4Y31EQ6v18a0W0URf0GoT9UNsR9XriCmLuwdkxIA000hc/UTrr4P4= Received: from CH3PR10MB7957.namprd10.prod.outlook.com (2603:10b6:610:1bf::19) by IA1PR10MB5994.namprd10.prod.outlook.com (2603:10b6:208:3ee::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Wed, 24 Jan 2024 00:30:07 +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.7202.035; Wed, 24 Jan 2024 00:30:07 +0000 From: Qing Zhao To: joseph@codesourcery.com, richard.guenther@gmail.com, jakub@redhat.com, siddhesh@gotplt.org, uecker@tugraz.at Cc: keescook@chromium.org, isanbard@gmail.com, gcc-patches@gcc.gnu.org, Qing Zhao Subject: [PATCH v4 0/4]New attribute "counted_by" to annotate bounds for C99 FAM(PR108896) Date: Wed, 24 Jan 2024 00:29:51 +0000 Message-Id: <20240124002955.3387096-1-qing.zhao@oracle.com> X-Mailer: git-send-email 2.31.1 X-ClientProxiedBy: MN2PR06CA0005.namprd06.prod.outlook.com (2603:10b6:208:23d::10) To CH3PR10MB7957.namprd10.prod.outlook.com (2603:10b6:610:1bf::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR10MB7957:EE_|IA1PR10MB5994:EE_ X-MS-Office365-Filtering-Correlation-Id: b3448061-88ad-433f-ac5c-08dc1c739de9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2dvFGwH7OmhRjIdzAcsR2j45edytQzA8/pih6r23SoA+XdzXrjbMhxWPbtXDTieRmS9bFWmtmkhXVHVpO04MDo7A0y2RczWlmv9CiCg9qx1QqvhsAArzHR0AwaaNasos42C15cxInSV70ZmCFqUv+3zRAtz99oVkLKjgSo632PTeEZVqkm0+i/zHilsQVEUph7tKqBBfeU16vr4n5iONHtWFltlCrc1YYbSNN5E/KXago3DuR6gi1ITpeKaLurT+k1Oc+1+WuExI2IQC1blYgU7lC9yxG0OqK9buohQiGtQeiknRyEuZw6f7Yg3lFYuKiPHFwn9tg/qfTy7uKVBToNAVLpIpV3aLv5ouV+dS8f7iYqLNyl38FSYAPnaqQcIVXza8HW3FKCZvdtexJm2Knf27Wk1/sSInvG4mu8rAR647hNQtKKIlH4nTa5pqQ1+/5wFS128sKgovM0DW258FqCyAzlqtugEipktfiOI2DBq7i6eBJ/+HCGAB8SqIBak9gZV82lOGvOq5T8drN6iuJyR3Sv/H8aul44YEopciXfbRwu0sDPIjjAmuV3ov86Ge0Lj90BXui3XSb3nI/6USG/7PRBySng6shDQS0M2qsGc0FJb4IR3Ker26fA+Q0G7AKq3GFX3Iv2Zu9OVn0OYtSIjiFVc4l37ZQO1IjbpHQTQ= 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)(376002)(136003)(346002)(39860400002)(366004)(396003)(230922051799003)(230173577357003)(230273577357003)(451199024)(186009)(64100799003)(1800799012)(6666004)(6486002)(966005)(478600001)(38100700002)(26005)(4743002)(2616005)(83380400001)(6512007)(6506007)(316002)(44832011)(5660300002)(2906002)(8936002)(8676002)(4326008)(36756003)(86362001)(66556008)(66476007)(66946007)(1076003)(107886003)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SIPEC1VQeR8IPvsqGKuBVvZMCp30lfS0TWy/qJDy5o/YZGTDPdvQet7XlaAwL/d8Gb44cbI1HcApfPNAdgh31ZrkWLj1rfqPfaAtwbgcrjY8CHUTAsoJwrrFb3hdVYYUIufm5HfDvLkhc1UFOBAjHtRccA/waTHiSfF3Vc2Lzczp8n/VPFpTC98qPA4uxwAtijoqj/wPGRB9ImqgrUzhgD8RIqoZruwlrHoR2bWO5Y/2B+iTHGI5fAj5EC/J/DE2aM9RzO1lhhxlcXcNoX2GDKUhJ1Oh4aMvvI8Va5MBAbwmzfuws3wUY5oLAyY6caHrS+2WIXMCuGwmHrf1RZC035QqYPIMyZhYDBIWFOkNvyO2/31uipBrZHZyab4NUuFRCIBeC/M+3Hixde1ozi0IjMvZx1wulQREQCyG+sNoH2sum5n0WEiS91rJFEtYnDGxLRqNP59wDsTLIfY8qQ31eGlX2vf4dQtVVyDtvLKp0Cd4aX2DYaLW0xoBSURC2CiSq08EIyhTpL8biRssDA65LIF5j0jY+BmSKkpMNlIcF30fquk45uEZfbfQEaZ5lWoM1PhTnGRK3lrYbCZKdWc1yvq2RX8TbhgxAIW4h3FoM3DwzioFtqR4mCdr9WW/pks7Wbuc1yoGqn4kV/wqyfRbmNudLFD4Wz/AqgOaynnMPXB2u0q3B/+iV8dJiq9Dv3QsyTHJkzLu1IxYXZNuPHNAcOWm6LLVeFJdoDQzoWkrISfuR/4KNF9/1+9WnNrulCMs8PAb2/+5JKvOcIKesYh3FElEmX9IvrEj8w+ibbbGMEBhD+Tb+FylNQZpwhVtyMPO4laKqPRK4OTz/5ay2/6qzqf2VIp3lCMrXe70SPZMisnka8pN0RZmnE4baXTWauxM9buUMgvCuVN06K5hz3bdU9l+iFRxeJyL2GG7eZ5UWBe9GxF1PDaxKfAqEnDUHDCpN1arcjGBr7dS2QQywDFgVNYqtZrnGZpw1a12cFJIf2/xlk9zwL5L84IVj+pUVipamSxs6T2GCDZZUlvXq588CAQocSsyAHDkK1ggAFp2otIopL0/aHke00m8xj+7zMEftol7xSnLNxK0EhFuV4GJ+jAKJARlS/trNKBW1NZvoM9Xm0/dXhkWESXTxJ+KDVz4i1ct98ahDSu08ASSVG6dIv5/oOiK8oMO5dPNPSDrt+QB+f3HAfHwbAg+wqS4ZTG8pUvpnv+b0Ypf3y2G5J6/+V9zRdrMzTkF52aV6saamBgLT6czcVFPHU5K0K9xFYfcs1Ap7JL+wtrRqcbvII+ijqXjQf11+iQ9kVZH7v71y9QJla9QbAgb7kyLz+VU4RG/RXPKNnRhnlhJrxHVEKWbMu4S+O5BMug5tODxQLvTVGaOWfKysIjccY3vBIGlQCWyZj+0bg+2MMJtZIYZlpZ8FghPTmHPAVmqt5GXJdue4OkgwzGjHC5HIht2mx7WLl2TIZeqXI1gLQdRlvECXkqCfw6aE4bSPTeB4NHpkdVLkyvwKlW0R7acPVMJuGgBkTmSJ0XgQw2Nk+Tvvqh7jiUQ2hwoE99jEIvzgudK1FQgcXsad9iDq5C+me9iaIBwlgR+ X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: GP7TjAKO+ytpARPq035UMl3woN4aBSP9HaowJaIrxy8zTpUXqSTLiehGSlJL0MJn6vkmdlAqSDrXrqdGvjG0MGduf7qSJ/GsoGsiAwQLYOOj26DOdY+i+3m7o9u34u+4Ha3BBe0vNJwpJiIJKP9WJPQyGBMCt/E3+uZjrpt5mAKV5PZsfChS4sAxXGPt3U0AfS0seaPyAsz6JBDQMUCyTePNWwgav7qyPG5uXpHReDjdw6dq8w/WO5z4hx136wCOgFi+ufMiN7sCUpQmP9VlLS2s6I1HbBviEYgesk9lQyVh+7G2vd+3lDyEo8ls8hV2Nz2YkV1uNeiosqOvgGiVkvrqIu5cNzFxJe89roFOMYjwvU2TvrSYV8GnuJ2Fc23skpyvYGh08MBxywSd6FNfthoTUHetcTu0rcZOK8zC2teI9iILzP9CYeYsg1dNPxM1d9pm74OlqZfbDNS4Qm0S+ZqcU7kpfDzycoGyliwbj2lekS9sfbHg/eA1cO7U7zaWLBHwmBX4/PNYfFn4t/IrT9vf7pWYBAaEeLz5UUcwXJF4/VKsgWmeJZ+SMf7hIWIPP9ZZ42BQBSFD5BvvnlfKtipD3oADRFZnU+pGYMNHOow= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3448061-88ad-433f-ac5c-08dc1c739de9 X-MS-Exchange-CrossTenant-AuthSource: CH3PR10MB7957.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2024 00:30:07.7140 (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: QcoeCsG3ng6FkVt7AAOPEL5iqDdc0Rb23Fu2iVqnL67bLbHqM45ES5ndSBHBhj0o9PlnKxPnoCRNa/O6BgLdvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB5994 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-01-23_14,2024-01-23_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 phishscore=0 bulkscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2401240001 X-Proofpoint-GUID: 8Dl2hQO5EztlEpKrW6twp7tyFWztbeOi X-Proofpoint-ORIG-GUID: 8Dl2hQO5EztlEpKrW6twp7tyFWztbeOi X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, 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: 1788929688645065868 X-GMAIL-MSGID: 1788929688645065868 Hi, This is the 4th version of the patch. 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, SIZE_OF_SIZE, ACCESS_MODE, INDEX) 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. 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 "PRECISION_OF_SIZE": The precision of the integer that REF_TO_SIZE points; 5th argument "ACCESS_MODE": -1: Unknown access semantics 0: none 1: read_only 2: write_only 3: read_write 6th argument "INDEX": the INDEX for the original array reference. -1: Unknown NOTE: The 6th Argument is added for bound sanitizer instrumentation. ****** 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) * 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. * testing cases. 4 Use the .ACCESS_WITH_SIZE in bound sanitizer Since the result type of the call to .ACCESS_WITH_SIZE is a pointer to the element type. The original array_ref is converted to an indirect_ref, which introduced two issues for the instrumenation of bound sanitizer: A. The index for the original array_ref was mixed into the offset expression for the new indirect_ref. In order to make the instrumentation for the bound sanitizer easier, one more argument for the function .ACCESS_WITH_SIZE is added to record this original index for the array_ref. then later during bound instrumentation, get the index from the additional argument from the call to the function .ACCESS_WITH_SIZE. B. In the current bound sanitizer, no instrumentation will be inserted for an indirect_ref. In order to add instrumentation for an indirect_ref with a call to .ACCESS_WITH_SIZE, we should specially handle the indirect_ref with a call to .ACCESS_WITH_SIZE, and get the index and bound info from the arguments of the call. which includes: * Record the index to the 6th argument of the call to .ACCESS_WITH_SIZE. * Instrument indirect_ref with call to .ACCESS_WITH_SIZE for bound sanitizer. * testing cases. (additional testing cases for dynamic array support) ******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