[GCC13,V6,0/2] Add a new option -fstrict-flex-arrays[=n] and attribute strict_flex_array(n) and use it in PR101836
Message ID | 20221005191320.2087486-1-qing.zhao@oracle.com |
---|---|
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp747864wrs; Wed, 5 Oct 2022 12:14:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7cLjE4/B2fP5uzcdvgSdFT7pjvyoV9lQi73amfaTtAJE6ksqPOJ/7YorDQEWr5EGkYLuIA X-Received: by 2002:a17:907:7284:b0:783:ca4d:1c49 with SMTP id dt4-20020a170907728400b00783ca4d1c49mr886669ejc.618.1664997281031; Wed, 05 Oct 2022 12:14:41 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id y20-20020a170906559400b00779f8e7ec5bsi7645781ejp.42.2022.10.05.12.14.40 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 12:14:41 -0700 (PDT) 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=@gcc.gnu.org header.s=default header.b=o6BZr5zZ; arc=fail (signature failed); 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=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 60A90385697A for <ouuuleilei@gmail.com>; Wed, 5 Oct 2022 19:14:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 60A90385697A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664997255; bh=NZhMpQIaS7HzCtnFcJoo4IrlTQTMJAM8jnLJfJQLA9M=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=o6BZr5zZObFmdwqGYsH9OY/7+rnSTe5giipOo3gPKVPcsaYdx/mpUIAPmk4zP/cJK edS9ucirk04mp1ZLTh/ZB51dwhN55mDBid/JuYxZZmW4nj2kAkhqlkDonXbc0ErD22 nAgGLymFjqlqjs/oBdQH0Efgj/5IL6fW0NNoHOQI= 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 B164E3858C2C for <gcc-patches@gcc.gnu.org>; Wed, 5 Oct 2022 19:13:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B164E3858C2C Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 295HdjM6017270; Wed, 5 Oct 2022 19:13:27 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 3k15up1ncm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Oct 2022 19:13:27 +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 295H9MPd037659; Wed, 5 Oct 2022 19:13:26 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2109.outbound.protection.outlook.com [104.47.58.109]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc05dqx7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Oct 2022 19:13:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TnyVqx91SU1/aTzFbZjT+44EiAwmAA0y/oijMk3U0p5ZGyO0f/60Bd1871oYNcl9E/BoCGw7O7AaAPKIasFIqzWZ7R8bfiMoP4+hGpd6kfHpt68kY2QqwHjN0dPsnsjJSkJ3FIxzucaXB29ITm6rS7VTCMb0QmBgG6OlNmnLchzeJ2kGWkV/ZOYE8yi1vsp2EMbGoTA0pyijIVlfCGaaQVuX7W6ugdDBqo4dQDXcHfpgH2YYYrpDIOLG2cPFSTZ0SDjZQlFfOSvIe+LgLpnO2U8spVAclqPxUpOoJlxRu7U3EKjkYU6Btn8fN8XCYLCmXEiHFfsBwjQilPfKZmWpfQ== 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=NZhMpQIaS7HzCtnFcJoo4IrlTQTMJAM8jnLJfJQLA9M=; b=A4SB79GHy4Sf729bAok3Nuk0fKRE+HKQ0q9Zf4WsfE/ASm8ePMmHk9LtsJ9CBbuPKmRYPuccf/O+hz88nVhhnNU/Kvt+6jaCa0WtMMBaay2PeW45yzAyFE63nMiRqqQFShccbd8Y3D7BIi8jZl2RLXqCmLTLJJriOGvpb/GW52hCWALdBdsy8uYGf8gjLT4e/wdg07jN1sJqfAWbFm8hFvAzJpV00O2mpcgzrWqrVHWLxoq/tpwlT66yDTLbMAVAKh7yKaaTO/TeAhJiYJ6mTNJWNL5hbanavVZ6TfJBq0rvI6RrjAg8aCQNBYb1mcI5OHMRcZaShSzZzSDgNwNiwQ== 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 SA2PR10MB4444.namprd10.prod.outlook.com (2603:10b6:806:11f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Wed, 5 Oct 2022 19:13:24 +0000 Received: from CH2PR10MB4344.namprd10.prod.outlook.com ([fe80::cbf8:6682:721e:835c]) by CH2PR10MB4344.namprd10.prod.outlook.com ([fe80::cbf8:6682:721e:835c%6]) with mapi id 15.20.5676.032; Wed, 5 Oct 2022 19:13:24 +0000 To: gcc-patches@gcc.gnu.org, joseph@codesourcery.com, msebor@gmail.com Subject: [GCC13][Patch][V6][PATCH 0/2] Add a new option -fstrict-flex-arrays[=n] and attribute strict_flex_array(n) and use it in PR101836 Date: Wed, 5 Oct 2022 19:13:18 +0000 Message-Id: <20221005191320.2087486-1-qing.zhao@oracle.com> X-Mailer: git-send-email 2.31.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BL1PR13CA0314.namprd13.prod.outlook.com (2603:10b6:208:2c1::19) To CH2PR10MB4344.namprd10.prod.outlook.com (2603:10b6:610:af::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR10MB4344:EE_|SA2PR10MB4444:EE_ X-MS-Office365-Filtering-Correlation-Id: b4264e3f-7eda-47a4-d742-08daa705ad12 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AktoOfOyH3inUEWCIMQbx3YJUIRPN3W3shdFbuf+mUdXafqyfvYQeuuAmKr9cY8q1IHIP0lm+K9Jfd7BmFzHwVP4GJGKi7Y8nDv1fLLqmKfF9o5kz3eThVLfFA7NVhZ4ywsQfaK+bSp043mP33OtgywFj86Fjfkrwen5yVSVRksO6Tte2Eq0G7z6/OPMDh7ZBm8Scf5LejgvBg0XoUL0EfEhp4AaS5F+mIVTD2Ey0Q7WLv+FICOutTs/ZjhdprhrQLmGWr6hBd7B10JzxalO2PfgPJxDbbXeOuMx4y8Q94BK2aB+9GsTL5TC5ZT57pBzjNWtg/6ngKqpid/A/awPoJIBoB/Fse4kUAGc826YtCdhiV0Qqmng6EhiDQyRVdqMiLp8MJG0cXey0nQqHE/n7SX6etYc0Iu3f8cgnvBJS7yCXFUTM/4pUJzW2UWTUs7wEWGksCerke5PUswQ5exi/xKDVZhXAVmkuQ2URUWm9J2ZLkFTBksVwHgkFV0Igug3tYA/jYGnkoASxpvvGyosUJkl9YVTz1ZzQalvTJLCaM6MTOWSIHGhFza0RRzQnfJacx0Cpq79qmyRBvtOtjVyoTgH5ybKzJsDxFLL1n/R0JvyUw2WFgnJ72DyNrEuZWxKby7gvmsqqoLps25yQMCT95XtNfTVb/Gr5Vths9IDsUe003cMC99jnVT3hB0OJdeVjS39KyyEHO7Y9sNKAD1fgg== 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:(13230022)(396003)(39860400002)(366004)(136003)(376002)(346002)(451199015)(36756003)(86362001)(83380400001)(186003)(38100700002)(1076003)(2616005)(4743002)(6512007)(26005)(6506007)(107886003)(6666004)(478600001)(6486002)(2906002)(316002)(44832011)(41300700001)(5660300002)(8936002)(66476007)(66946007)(4326008)(66556008)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount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BmH66vjz0uPr0bNUE7R2arfFdlNH40euTyTCyLvmAGFRcTPTMcjdFKvbU/VL1ZDmGD7fAhH+TfpDbQdJ4shxTowv0YYuzmLD1UjS59Kr6hUSq1/S9AIWgw6nwe2TQ50wU5M8J9B3u/yUNFgojpEGhbXc/J58SLF2qrliy1rfHjT/mVXBMWEHz/s1Il7Rh13rCOBEm5vmHIPW+fcc43h4Rqy40jJiAeu2ItVvlmfJDXHlJ0I8y+VCwfs23zBUlSmHvIfMhy29QgFMsLnzfFQBUSNA7cJDBo6SBGxDaDwH65a4QaXVWQFzUKpPmewVAuleMv6ye3q1wV0jh+7Ut2fHqv5GPY7wu1lX5+ynzvA/pSx1C/BsvH8oEtJdDm66Mj8U9SVAHK4RpEocIAqXDpixYz55EMeu3KpO63NaoWCvdFa1UtrJ6CWUZHAHXs5lFqiD3oBIEEnvqsQDKBQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b4264e3f-7eda-47a4-d742-08daa705ad12 X-MS-Exchange-CrossTenant-AuthSource: CH2PR10MB4344.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2022 19:13:24.7652 (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: WvuT5IV11gyMkXbPxXleAPXaV3h/9QNfNRXUNKZk/TvkU6H3gn45Q+rtseAJ4OfcWEgZwUS3C4ELBu3U+ayklw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4444 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-05_05,2022-10-05_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210050120 X-Proofpoint-GUID: GcwqnAd_qzMGxZwLp0aaKe4u3tvqrQBI X-Proofpoint-ORIG-GUID: GcwqnAd_qzMGxZwLp0aaKe4u3tvqrQBI X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, 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: jakub@redhat.com, rguenther@suse.de, keescook@chromium.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?1745876188932511553?= X-GMAIL-MSGID: =?utf-8?q?1745876188932511553?= |
Series |
Add a new option -fstrict-flex-arrays[=n] and attribute strict_flex_array(n) and use it in PR101836
|
|
Message
Qing Zhao
Oct. 5, 2022, 7:13 p.m. UTC
This is the 6th version of the patch set. Compare to the 5th version, the major change is: (Address Joseph's comment on the attribute): 1. to require the attribute to be applied to a declaration; (c-family/c-attribs.cc) 2. update testing case to include such case; (testsuite/gcc.dg/strict-flex-array-1.c) Compare to the 4th version, the following are the major change:(Address Martin's comments). 1. change the name of the attribute from "strict_flex_arrays" to "strict_flex_array"; 2. update document to update all mentions of flexible array member with additional qualification "for the purposes of accessing the elements of such array". Compare to the 3rd version, the following are the major change: 1. delete all the warnings for the confliction between -std and -fstrict-flex-arrays per our discussion. 2. delete all the related testing cases for these warnings. 3. update all the wording changes, and documentation format changes recommanded by Joseph. I have bootstrapped and regression tested on both aarch64 and x86, no issues. The above changes are all in documentation and FEs. Since the Middle end change has been Okayed by Bichard in the V3 of the patch review. So, Joseph, could you please take a look at the FE and doc changes and let me know whether they are good to commit? thanks a lot. Qing Qing Zhao (2): Add a new option -fstrict-flex-arrays[=n] and new attribute strict_flex_array Use array_at_struct_end_p in __builtin_object_size [PR101836]