From patchwork Fri Nov 17 02:53:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Carlotti X-Patchwork-Id: 165977 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp263250vqn; Thu, 16 Nov 2023 18:53:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IHIZ4tEV85jVI5zGoi1QFzK8kScTTprseghtzw1hSnthyc0HrULYjh6PdZ3/F2oJWqJ7abz X-Received: by 2002:ad4:4e6d:0:b0:66d:2435:b3f8 with SMTP id ec13-20020ad44e6d000000b0066d2435b3f8mr9192961qvb.4.1700189635128; Thu, 16 Nov 2023 18:53:55 -0800 (PST) ARC-Seal: i=4; a=rsa-sha256; t=1700189635; cv=pass; d=google.com; s=arc-20160816; b=yioZ1yvTEYr1e7RWDanBtEwlLnz5ete48RY3SRlICw0Br4xsVgXAwG2ZQdP+uiWv7b 7M8NGayR5SRsxVpTb3mPOug7t+RmEl279Nr6M6NCyaV1FN0u81FWYFxL95/LOLxSrwpB otjVWdIu8pfTC70Qn/gBk22GvT/1EjqA31SVTzzKQDrEfY9onno2i7/z82oeZ8qUVOCm E9iXIGdJGagiacUiW/J0i3vHD6mQ7cw773s4HWqWtSVaCEeM4jceHhBN4LmaV5P5OHjC HH8DpicEBk/AXEr1McEw66qfWqspHO4LnIohw8HIWKLP1sddczL8O6TiBJt22Pec3ax3 DJrw== ARC-Message-Signature: i=4; 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:original-authentication-results :nodisclaimer:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date :authentication-results-original:dkim-signature:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=fJxy/sfd3UtXmE9kM+UB8m46uqW7+wjMwQqVELxYwOU=; fh=c97l7tNY4uySJtRltYKrq/HN5hcV15xwhnkOEwrZ84g=; b=1GEoQUirwcyZ/ZvKPzKEJkwGtJVCjoWOsBlUxWL8Tra9EaI1sq2l+P4aKLKHGRhCM9 ZZul2KFujTEMqNGR4dU1g/xM+aygia+/g2O6eLLfMwWHuzHPsiJLQHn6IUX4/53Hw5hj tU40TCBwKFeMP7OrAz28xjTLiP2WbTOBEfzR1Mds7xXs+0viqTR7RVh2hXY+HQL1o7qA LXF+0SVdGqps6KVA3nzm8UJzgOFoA5fciWlexyofgdfbJ1ygCf6uD9dKCto8Y198r9vz hw///mOmb25nEzG0z/im3EU3L1UoXEOYaT0OzSgFf+fVlMVIQJJNuJLpkymtNLFs88sK OmcQ== ARC-Authentication-Results: i=4; mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=fetfYMQL; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=fetfYMQL; arc=pass (i=3); 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id v7-20020ad45287000000b00646f2d31709si804974qvr.178.2023.11.16.18.53.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 18:53:55 -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=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=fetfYMQL; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=fetfYMQL; arc=pass (i=3); 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D6F033858414 for ; Fri, 17 Nov 2023 02:53:54 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2081.outbound.protection.outlook.com [40.107.7.81]) by sourceware.org (Postfix) with ESMTPS id 161D53858D37 for ; Fri, 17 Nov 2023 02:53:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 161D53858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 161D53858D37 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.7.81 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1700189610; cv=pass; b=yB7/8T6zEJJS1Ktij0HPz29pcmfIrs5lslMtysY9WAF/08erpZMwM4A6IIvDa/ZJqJ5ny26EOQ8bOK0k+8yttRl9LvY9SycgD0aoN3HRqUvSpVJpIc3oXhYywm5N940tjJOI68mU53E+BHJbLAtVoz2UoAV9XG0hwVet0chL1zg= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1700189610; c=relaxed/simple; bh=P6ghWGBIhLPS+oMowenngwHYi+szUSx70ZTw/DqM3BY=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=Vcgv3y9prBC8H6IlMvpQQjD+QhBayhnkXDZ4Rb/Cegne9Y6EPsJe/x4sWjJLpFSgG8pMGrWj3+M3mqPiA5qwLnO8AxPXkuqVruV1mflWB7iY98CTHddr9mr7WonbAJFwHeLwC5v16CM6Mq6EFNcpbfPwftRJ/r8c6NsE5j+95EE= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=HOts3yjNtVLb+kwDjixySsLmQ/BLzsR2rVakTT/5Ug0B3A+cjn4Ke79HNtHgFOQsiITz4S397qyMF4vBk9mKuLMUSmdBc6KRZa/z32ZVW6R+vDxHMSdPYxXKSjc0sUtUkXd557h6kRokO/1zjCrqZRGGAmdCfgkLzjRbTcqkN61iusXscQ+FfViYnn76cw1Gt1sXxmVTC/Djl4KyTGNm/7oQJlqrcAhMEybtERCQip8pKgCpqec+aT2hxtQk+nh5Q2o6Zf9LNL7kHXVivoM2n2LiHArTMslNg6tMNqyjL7xmoZ+DLccXVYA48RHA5031NHneFRBCH4FAbDsNg8Wljg== ARC-Message-Signature: i=2; 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=fJxy/sfd3UtXmE9kM+UB8m46uqW7+wjMwQqVELxYwOU=; b=Rnom4Ei/uVEdOZ7Z/zcbl7USy5E+WrXHP+1ZQnEbTQUH9QqQsyNJdtwLW5T1UaflkF7aONeSf/iRb9QJ+gufPRwhM4xa/L03a+0u+i/3cjVE1jpLvBmj/rKB0KNuB9JASBNl0rG0HZxX2FKlELv/Nz7BrVHN5O6XNsAmN8SkTRI3mHbCs73KSmkLheK3+sxadWOUUD5V0BZlVJ+zQ/Q3SwTvqV5sh+PM97PVlLK05NmR4vOChZToi6B1hdZ7ZaJjzE1QKZ7tc/9q6x2n/yokK7D7c3Xu6JwF41BVgI7NOEcI3KCtrT9TfkGLppu7Dy9bPR1NCdJv9kJIpX/3Qin95g== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fJxy/sfd3UtXmE9kM+UB8m46uqW7+wjMwQqVELxYwOU=; b=fetfYMQLMCJ/acXE3NS2Zx+4sTj7+QBHgZeLENa0k/y3Ge+KNjTAj8kSnTYikTLfhp2b2hfEGKeMU3OajgMZ9QsS1svLyYdSm6penKkux8wFJJ+mqcHN/AY1hzl8MYvbymBj8NI4YfhkyEKryXysHPMmCgh8KFFDLqSaJxOY4e8= Received: from AS9PR05CA0360.eurprd05.prod.outlook.com (2603:10a6:20b:490::12) by AS8PR08MB9573.eurprd08.prod.outlook.com (2603:10a6:20b:61b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.18; Fri, 17 Nov 2023 02:53:22 +0000 Received: from AM2PEPF0001C714.eurprd05.prod.outlook.com (2603:10a6:20b:490:cafe::4e) by AS9PR05CA0360.outlook.office365.com (2603:10a6:20b:490::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.21 via Frontend Transport; Fri, 17 Nov 2023 02:53:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM2PEPF0001C714.mail.protection.outlook.com (10.167.16.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.19 via Frontend Transport; Fri, 17 Nov 2023 02:53:22 +0000 Received: ("Tessian outbound 26ee1d40577c:v228"); Fri, 17 Nov 2023 02:53:22 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 90b4c45a5148ad8c X-CR-MTA-TID: 64aa7808 Received: from 836e2e00f4ae.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 1ABF7DE1-34BA-4AB7-A45D-8F796F8F3DE4.1; Fri, 17 Nov 2023 02:53:11 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 836e2e00f4ae.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 17 Nov 2023 02:53:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e2WhWhsJyJWtM3Ak0M4z658bYh/8dLGanc24KIkOBah0gvtNol59ZSL/FQG+lJkLDfeCtRtyXMxdg5hW6D4NDYzldHwx3hu/Ubeean+L5JMdeLALUpgvleQXrnMTmrRMyXGVSXMP7of6l06OPB12JIcso4j/X31cONH2KCHGeJoDlvrybB5cxkLwlD7qxMG6XV5PDkPfSiMFP4fpJwjOmWnTsKdukiMt/zcyN7MYcr6Ofxa5Wa2nhhNmmm3PfWJ77vsZD46KRVb7hpueOqQpbSm7gqSCEngmMefEQmJJfvv1yRQlMA0wKADKAtR6/PI4oHrXCpz1D4m8LbPa9s3vmw== 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=fJxy/sfd3UtXmE9kM+UB8m46uqW7+wjMwQqVELxYwOU=; b=eOWVYpSwo4KLAbOCUIFREQeZMwqKhK0Gzted3PEKNn6GqyowEY5zrE6oyp7yEmYuW7v8YY02RCPVrEwZgO2Fd+sT7bVsv5F/qI4CJGrNsksd6Nf4gG6FiejhbXDnER+3UYbqBtTKr/Eu7N+mNo9V7NaCZ+v8I3SP1EvVW5wcoX+4MjBFiD0N6K5OdEn88LqzAW5zuQVBt0yxVVJ2mOerPSbKW642dmplie0rdyQ0ER55Rz0KMb8k2fIu/X/NcTiPSjm/wjmjNkskxXtllKcUyvF/WEsnImVXzXa6TTb0eTLTG2G95U7DfezkgoEvogt+2NIS7ubSv6M14ZQWpMcEAA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fJxy/sfd3UtXmE9kM+UB8m46uqW7+wjMwQqVELxYwOU=; b=fetfYMQLMCJ/acXE3NS2Zx+4sTj7+QBHgZeLENa0k/y3Ge+KNjTAj8kSnTYikTLfhp2b2hfEGKeMU3OajgMZ9QsS1svLyYdSm6penKkux8wFJJ+mqcHN/AY1hzl8MYvbymBj8NI4YfhkyEKryXysHPMmCgh8KFFDLqSaJxOY4e8= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6678.eurprd08.prod.outlook.com (2603:10a6:20b:398::8) by AS8PR08MB9409.eurprd08.prod.outlook.com (2603:10a6:20b:5a8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.21; Fri, 17 Nov 2023 02:53:10 +0000 Received: from AS8PR08MB6678.eurprd08.prod.outlook.com ([fe80::af15:c9d7:cd8c:6da2]) by AS8PR08MB6678.eurprd08.prod.outlook.com ([fe80::af15:c9d7:cd8c:6da2%7]) with mapi id 15.20.7002.022; Fri, 17 Nov 2023 02:53:10 +0000 Date: Fri, 17 Nov 2023 02:53:05 +0000 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Cc: jason@redhat.com, nathan@acm.org, rguenther@suse.de, richard.sandiford@arm.com, richard.earnshaw@arm.com Subject: [PATCH v2 2/5] c-family: Simplify attribute exclusion handling Message-ID: <408e5c77-961f-4613-009f-d0dea61a37ca@e124511.cambridge.arm.com> References: <88dc78af-82a3-9a9f-4b8e-461c41d296cc@e124511.cambridge.arm.com> Content-Disposition: inline In-Reply-To: <88dc78af-82a3-9a9f-4b8e-461c41d296cc@e124511.cambridge.arm.com> X-ClientProxiedBy: LO4P123CA0181.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a4::6) To AS8PR08MB6678.eurprd08.prod.outlook.com (2603:10a6:20b:398::8) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6678:EE_|AS8PR08MB9409:EE_|AM2PEPF0001C714:EE_|AS8PR08MB9573:EE_ X-MS-Office365-Filtering-Correlation-Id: 188b2fd9-047c-4630-a9b1-08dbe7185ce4 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: q9xYPhzFvJBC0MsUuKO5ZqNTmy1jzPLyE2/LuyWmihsrq/iNhtNVbmmrLkB+VMYitIpTLkbWUc/9Scfa8Vh18wr0kQxkHYxTDzM+MrXUOS34bOtrpVdgyb9ic0r3ywwbz3LlGpGvUX5DTzodeY+61YWPRZ1QZrohUzZNOc/TQZ11L/pXWoAFjlbdhzfrcx3uyQpfYRLl39VLUTk4veCIQwbkq+CzLuvmKTtaH0KkJci/JlTPYmyxI01bQAQbsT6AzzW1BzbA/4qq7WC5T0MrAOji1YELnwOxGpbm0TsE7isaLZ2BSbXT6X8fnMdHc32i6RGf1FRCC3CUNLLAMz3XN2WyeWCDk7LqF3XCRXpx5nJtqTWIzzYpjhMt0Y3I06JKk1Ao/A/tS41uLv/gd09XuEAPJB+3OXEm44p3Fwi64LWngyEK15PXO9zzTYe59opKxkcgFPfB6YUwHQKYNZ77u9LKDW5ZOEoAnnPNP3AKRaiHD+K2AZyB2vQpJtS1C5zzu6ITJD25Kvm2/5F+/gpUqf8Ms4IA+LHVV0FHLeNqKaB0cc80mUO/eRMxLOsvsbNfQkfgjOj6x7+vc/ouoK6OcLZFJC6NPMoU4/oaYnWQlPwF6GJ6HVEMaxdL8rlmUyez X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR08MB6678.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(366004)(39860400002)(376002)(396003)(136003)(230273577357003)(230922051799003)(230173577357003)(1800799009)(186009)(64100799003)(451199024)(2906002)(31686004)(38100700002)(31696002)(86362001)(5660300002)(44832011)(4326008)(41300700001)(8936002)(8676002)(83380400001)(6916009)(6512007)(316002)(26005)(66556008)(66946007)(66476007)(6666004)(478600001)(6506007)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9409 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM2PEPF0001C714.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6867f7c7-6e72-4799-2f29-08dbe7185562 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AMvbYYNdxMtwDRcfmy1oVhtaOsMJsKRQgrO6np3lGXQo3I9kBYyzIWJpm18mYGIzZWx0ZA39XNwG7TBX+XA53VUAyxFFHCOU49awVayyBdn9tDRvNqF+aIOGB4kjdIwIJ3Kha1utj80RnOu+LtR0p6am8X6xrkarLWaQt/Ux6LfqHADBY3uV3nl/XAox0R3uHVgfb4ELjp/KErpq9Ck9EWa2/0/+9QracTj3hUGI6825m1J3l/HohL7/IOADaMYa4e4ZiJgHDEaOef5RJ5/DkeywliDwKc5Tm4nOi222ebSRtH6LWWBSKXhmWLly6BMhCxjnnHUIMi3jDnKFhDU/oA/jBP3gZz/+sItRhXzaB3fbdugvIkeOzjCmXl3hDrZP/HyLVAxnAoQX30kEaYg2uxITVizKQt+UoDupKfevWjtqM+xtuA+rHAd8YhRwg3mNbXYyvIu+dOqtW4BF8sMw+93b+MQ/CZCrRjT5BQty0Y35sOYbVVATaQpzhAKOMq1fW2W7A+P0wYFfmUfYyL5NLV10Jl35FqjUAcWHRLchOi5vMAi56r6gNyj5dbqHH9d7lY7o+L7PP6HE7F81nwkBmQ220mhguRFacr9eaMnbQoXYOTrvRCVTjJYsev8y/zLfsfmXryf7Mmk7slwYLlFb/fOSymlXcNe+FNgN5sRE4HfR2QOsIjzUngX/wLIffDdkwM2j4uGu2rkHbJYVV3KDEzzT7DJ7y4vykrYjrRNsclwycZgjf2lrN3z1a8xbzJ7F6a6fy4ECsZP6mEJCok59joniLmhajrn4IMd8Hyn5/hQ= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230031)(4636009)(376002)(136003)(396003)(346002)(39860400002)(230922051799003)(230273577357003)(230173577357003)(186009)(1800799009)(451199024)(64100799003)(82310400011)(40470700004)(46966006)(36840700001)(31696002)(2906002)(478600001)(6486002)(6512007)(6506007)(40460700003)(6666004)(86362001)(70206006)(5660300002)(44832011)(70586007)(8676002)(316002)(36860700001)(8936002)(6916009)(41300700001)(47076005)(82740400003)(31686004)(4326008)(81166007)(356005)(83380400001)(26005)(336012)(40480700001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2023 02:53:22.6153 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 188b2fd9-047c-4630-a9b1-08dbe7185ce4 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM2PEPF0001C714.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9573 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY 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: 1782778047130217519 X-GMAIL-MSGID: 1782778047130217519 This patch changes the handling of mutual exclusions involving the target and target_clones attributes to use the generic attribute exclusion lists. Additionally, the duplicate handling for the always_inline and noinline attribute exclusion is removed. The only change in functionality is the choice of warning message displayed - due to either a change in the wording for mutual exclusion warnings, or a change in the order in which different checks occur. Ok for master? gcc/c-family/ChangeLog: * c-attribs.cc (attr_always_inline_exclusions): New. (attr_target_exclusions): Ditto. (attr_target_clones_exclusions): Ditto. (c_common_attribute_table): Add new exclusion lists. (handle_noinline_attribute): Remove custom exclusion handling. (handle_always_inline_attribute): Ditto. (handle_target_attribute): Ditto. (handle_target_clones_attribute): Ditto. gcc/testsuite/ChangeLog: * g++.target/i386/mvc2.C: * g++.target/i386/mvc3.C: diff --git a/gcc/c-family/c-attribs.cc b/gcc/c-family/c-attribs.cc index 461732f60f7c4031cc6692000fbdddb9f726a035..b3b41ef123a0f171f57acb1b7f7fdde716428c00 100644 --- a/gcc/c-family/c-attribs.cc +++ b/gcc/c-family/c-attribs.cc @@ -214,6 +214,13 @@ static const struct attribute_spec::exclusions attr_inline_exclusions[] = ATTR_EXCL (NULL, false, false, false), }; +static const struct attribute_spec::exclusions attr_always_inline_exclusions[] = +{ + ATTR_EXCL ("noinline", true, true, true), + ATTR_EXCL ("target_clones", true, true, true), + ATTR_EXCL (NULL, false, false, false), +}; + static const struct attribute_spec::exclusions attr_noinline_exclusions[] = { ATTR_EXCL ("always_inline", true, true, true), @@ -221,6 +228,19 @@ static const struct attribute_spec::exclusions attr_noinline_exclusions[] = ATTR_EXCL (NULL, false, false, false), }; +static const struct attribute_spec::exclusions attr_target_exclusions[] = +{ + ATTR_EXCL ("target_clones", true, true, true), + ATTR_EXCL (NULL, false, false, false), +}; + +static const struct attribute_spec::exclusions attr_target_clones_exclusions[] = +{ + ATTR_EXCL ("always_inline", true, true, true), + ATTR_EXCL ("target", true, true, true), + ATTR_EXCL (NULL, false, false, false), +}; + extern const struct attribute_spec::exclusions attr_noreturn_exclusions[] = { ATTR_EXCL ("alloc_align", true, true, true), @@ -332,7 +352,7 @@ const struct attribute_spec c_common_attribute_table[] = handle_leaf_attribute, NULL }, { "always_inline", 0, 0, true, false, false, false, handle_always_inline_attribute, - attr_inline_exclusions }, + attr_always_inline_exclusions }, { "gnu_inline", 0, 0, true, false, false, false, handle_gnu_inline_attribute, attr_inline_exclusions }, @@ -483,9 +503,11 @@ const struct attribute_spec c_common_attribute_table[] = { "error", 1, 1, true, false, false, false, handle_error_attribute, NULL }, { "target", 1, -1, true, false, false, false, - handle_target_attribute, NULL }, + handle_target_attribute, + attr_target_exclusions }, { "target_clones", 1, -1, true, false, false, false, - handle_target_clones_attribute, NULL }, + handle_target_clones_attribute, + attr_target_clones_exclusions }, { "optimize", 1, -1, true, false, false, false, handle_optimize_attribute, NULL }, /* For internal use only. The leading '*' both prevents its usage in @@ -1397,16 +1419,7 @@ handle_noinline_attribute (tree *node, tree name, int ARG_UNUSED (flags), bool *no_add_attrs) { if (TREE_CODE (*node) == FUNCTION_DECL) - { - if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (*node))) - { - warning (OPT_Wattributes, "%qE attribute ignored due to conflict " - "with attribute %qs", name, "always_inline"); - *no_add_attrs = true; - } - else - DECL_UNINLINABLE (*node) = 1; - } + DECL_UNINLINABLE (*node) = 1; else { warning (OPT_Wattributes, "%qE attribute ignored", name); @@ -1487,22 +1500,9 @@ handle_always_inline_attribute (tree *node, tree name, { if (TREE_CODE (*node) == FUNCTION_DECL) { - if (lookup_attribute ("noinline", DECL_ATTRIBUTES (*node))) - { - warning (OPT_Wattributes, "%qE attribute ignored due to conflict " - "with %qs attribute", name, "noinline"); - *no_add_attrs = true; - } - else if (lookup_attribute ("target_clones", DECL_ATTRIBUTES (*node))) - { - warning (OPT_Wattributes, "%qE attribute ignored due to conflict " - "with %qs attribute", name, "target_clones"); - *no_add_attrs = true; - } - else - /* Set the attribute and mark it for disregarding inline - limits. */ - DECL_DISREGARD_INLINE_LIMITS (*node) = 1; + /* Set the attribute and mark it for disregarding inline + limits. */ + DECL_DISREGARD_INLINE_LIMITS (*node) = 1; } else { @@ -5650,12 +5650,6 @@ handle_target_attribute (tree *node, tree name, tree args, int flags, warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; } - else if (lookup_attribute ("target_clones", DECL_ATTRIBUTES (*node))) - { - warning (OPT_Wattributes, "%qE attribute ignored due to conflict " - "with %qs attribute", name, "target_clones"); - *no_add_attrs = true; - } else if (! targetm.target_option.valid_attribute_p (*node, name, args, flags)) *no_add_attrs = true; @@ -5696,19 +5690,7 @@ handle_target_clones_attribute (tree *node, tree name, tree ARG_UNUSED (args), } } - if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (*node))) - { - warning (OPT_Wattributes, "%qE attribute ignored due to conflict " - "with %qs attribute", name, "always_inline"); - *no_add_attrs = true; - } - else if (lookup_attribute ("target", DECL_ATTRIBUTES (*node))) - { - warning (OPT_Wattributes, "%qE attribute ignored due to conflict " - "with %qs attribute", name, "target"); - *no_add_attrs = true; - } - else if (get_target_clone_attr_len (args) == -1) + if (get_target_clone_attr_len (args) == -1) { warning (OPT_Wattributes, "single % attribute is ignored"); diff --git a/gcc/testsuite/g++.target/i386/mvc2.C b/gcc/testsuite/g++.target/i386/mvc2.C index 7c1fb6518d04f404123086660c32853dcd9f65ba..04ee0573d607f6de2e7ea382e891f62884c18ea7 100644 --- a/gcc/testsuite/g++.target/i386/mvc2.C +++ b/gcc/testsuite/g++.target/i386/mvc2.C @@ -3,7 +3,7 @@ __attribute__((target_clones("avx","arch=slm","default"))) __attribute__((target("avx"))) -int foo (); /* { dg-warning "'target' attribute ignored due to conflict with 'target_clones' attribute" } */ +int foo (); /* { dg-warning "ignoring attribute 'target' because it conflicts with attribute 'target_clones'" } */ __attribute__((target_clones("avx","arch=slm","default"),always_inline)) -int bar (); /* { dg-warning "'always_inline' attribute ignored due to conflict with 'target_clones' attribute" } */ +int bar (); /* { dg-warning "ignoring attribute 'always_inline' because it conflicts with attribute 'target_clones'" } */ diff --git a/gcc/testsuite/g++.target/i386/mvc3.C b/gcc/testsuite/g++.target/i386/mvc3.C index 5d634fd7ea68b905a0e93ca1c25f6907bc9d2858..5ad1f88fd2d7da74fafcafcff24b77cb2d12a5a0 100644 --- a/gcc/testsuite/g++.target/i386/mvc3.C +++ b/gcc/testsuite/g++.target/i386/mvc3.C @@ -3,7 +3,7 @@ __attribute__((target("avx"))) __attribute__((target_clones("avx","arch=slm","default"))) -int foo (); /* { dg-warning "'target_clones' attribute ignored due to conflict with 'target' attribute" } */ +int foo (); /* { dg-warning "ignoring attribute 'target_clones' because it conflicts with attribute 'target'" } */ __attribute__((always_inline,target_clones("avx","arch=slm","default"))) -int bar (); /* { dg-warning "'target_clones' attribute ignored due to conflict with 'always_inline' attribute" } */ +int bar (); /* { dg-warning "ignoring attribute 'target_clones' because it conflicts with attribute 'always_inline'" } */ From patchwork Fri Nov 17 02:54:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Carlotti X-Patchwork-Id: 165978 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp263570vqn; Thu, 16 Nov 2023 18:55:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IHn45F7Sn42Oqxrn2jyOy4lMvBNSvNH1/Bf9igKRye9pALnEAayyeYPi7jJoSwOIcdS3G+v X-Received: by 2002:a05:620a:450a:b0:777:7240:8de with SMTP id t10-20020a05620a450a00b00777724008demr13475760qkp.8.1700189701357; Thu, 16 Nov 2023 18:55:01 -0800 (PST) ARC-Seal: i=4; a=rsa-sha256; t=1700189701; cv=pass; d=google.com; s=arc-20160816; b=YDQqvR++gf8D2oBL1AP9LOLbT8jAb3hW6BfS5bL6qhIi467Diz2AvZBCczRpbaaMWJ 64BkHNTTRF1NVI6EACd6JdQpputZY4VplIbAZTjlfYIVlshdagTRGz82jJUKqQ1cJ5dd X8woFF3ZNRdZLUZvyP9iSBJnhbwDehTm0kqDtVVQn0P6MVq3OoTYQHnXozXi9VO6Fm8V WdQju5hnN2bMvJHFkEAxNSvJkm06yW06dcVRCaBmPZbZT+fj/13yM+m9RVPhA1SzBXRF 7L/slzabf6jVwSORpZo1nZLd1kAcCfWqd4wIalR/UJ1r7uhJtcx4JbTPvrtafJRj/cCL JNvQ== ARC-Message-Signature: i=4; 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:original-authentication-results :nodisclaimer:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date :authentication-results-original:dkim-signature:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=u5+mgrXayMqpj6hWtanl6hFOmOo0TqljCyJE463THBw=; fh=+GNZkyWceKhxQqJXqthR/Snwfj7KEBGAdykKQTEwA4A=; b=Q3mmS9inPbZNTsAts1+Gnrno7zw+189Etw7R2mEkX0kG/R2bkkvwBBblVJcCQQ6PhO ncXWoG+ydlddFZU0zvksut/IMNApjafgzoqJnCXOb3uMJB9WFK9gSLg36m3xZs4COkxm 4LofxLhnLLP+mf8axy5Kd8zcVTJs6Xc/6haSbCTnyR9sUNnlMtRtIDnbQO0jwfl0rq3E BbY2/G5iFH9sKXgLMxQgU6j1p4xwfnkYYM854K5Mpfwq0TIJ1R4s4/yO82eqAkTluDbe oxJBgh/z3J8bkvuG2mC8UHuCoafo1Ma0TPqPnyYbA/k6zZM8flMtRk7brzCcyUYwFvTc WMrg== ARC-Authentication-Results: i=4; mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=M3tMk+3Q; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=M3tMk+3Q; arc=pass (i=3); 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id s22-20020ae9f716000000b00778ad9f91bfsi775509qkg.606.2023.11.16.18.55.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 18:55:01 -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=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=M3tMk+3Q; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=M3tMk+3Q; arc=pass (i=3); 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1FBCB3858D39 for ; Fri, 17 Nov 2023 02:55:01 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2078.outbound.protection.outlook.com [40.107.8.78]) by sourceware.org (Postfix) with ESMTPS id 2270B3858D28 for ; Fri, 17 Nov 2023 02:54:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2270B3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2270B3858D28 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.8.78 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1700189677; cv=pass; b=V+IfQLemYnCJb/97+kxrtqxcecfqd7bL0l10V1lBQEg6ybF0HnUTXJs0fNv6FS5xVndFVaU/HsSHcjoFfbnx8b+I1Juh85XPJQ8/io7ZcYGAGD0LNkpWoPa1EWwiTXr8M1s7zqOGEQLgCIENYfK6cqnygd/f+ljOEh3fiPWu/O4= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1700189677; c=relaxed/simple; bh=R/yIovM78oGUISCpxJaUAEroKmLeGGlFifoHeOqrI9c=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=OMRI+AYstedQQkGZ/j1GLXANETVzd6mJElxxsqdD7x3RF4t9+CkaPrasgFpI+eRpmOL79x9VU7Fzd/1ba1WyvmyYgXix8cvkouaM0CtUdPGx1Ex6VgS9kMg4Mo5JWPaNJoCyCbfcQbWm225Oe/o31TFcyKxyr249fYwcXZlpTl8= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=JG5dG8nukXCVASVjNIqHYTV5WCO0SH6uPizsJHHCbfiZi57zFTXQ1SKevgEbCYQXL/AnCMF0co/tyhEwOMOQAeL5cPp2ke67+Vn3laAnvizM8a2l0HeZeVfd/JCpw0Buht+atloLabfFUeki3kG6ySNH68r8JMM29Sj/IWVq4Vg609iwqLJYuMXHp3bj6DtzKbXDy0agVLoIXPN+zKp9M8DEfEKNlHb92MitwkQc15vQ71O4zrQ60QgV+TAVJDd0/l8iIdOSFlEmfcBO0o53fRn2g7zwVNf64MrZ3CkcUe/r3FN6CQyVgaRc4V2hFI2HsmPJa93q1B9LvSQgQQePHw== ARC-Message-Signature: i=2; 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=u5+mgrXayMqpj6hWtanl6hFOmOo0TqljCyJE463THBw=; b=E4o6A1r7OnuJ9+cLeYDYVBIHU4b7y5bpvhyTnA6ITs7OKclVv6L4sCNUTdrgNOvyZulk2ueX3lG+w9jWw4Bg8fjWeHu/eJkcHjGXoPn4hi8ZFu5xXJ7bkO2MNUKYpsrOwaYnL0gnNXNjtdFxPn4LZCmp1pwB576OCj2IajsUltldGd+/nWEzwUyhRWs4sw0Zl4spQjsSRK5B8QsanRn+rASN6+G8SmdEAtwsPBBfWpql4JyorfeGoWFtOdDmBdhpmQNO/5QuotOBZXbSueOsDMa4jQ7TXDzk7eruBElhEqSwQYD9cSHYxxUvBIqWf1qyG/Qx4nIYijN79KlLUwOIFA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u5+mgrXayMqpj6hWtanl6hFOmOo0TqljCyJE463THBw=; b=M3tMk+3QYKxiFO950rh8VwPzG9/h1KTFjEqZYos2CBnI2u+4okfhYQnLh1tnhGaLV3seShFCW63LU+r3iNUKtyKN8bleSy47jC/kKqiA8sC+Y6Un9u+ULBkJXHraD1u8jEBvPaVQDZos5GDDA79L8wI70ZATqmWl8qxEkGzK3W8= Received: from DUZP191CA0029.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:4f8::17) by AM9PR08MB6260.eurprd08.prod.outlook.com (2603:10a6:20b:283::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.23; Fri, 17 Nov 2023 02:54:28 +0000 Received: from DB5PEPF00014B9A.eurprd02.prod.outlook.com (2603:10a6:10:4f8:cafe::ec) by DUZP191CA0029.outlook.office365.com (2603:10a6:10:4f8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.21 via Frontend Transport; Fri, 17 Nov 2023 02:54:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5PEPF00014B9A.mail.protection.outlook.com (10.167.8.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.20 via Frontend Transport; Fri, 17 Nov 2023 02:54:28 +0000 Received: ("Tessian outbound 8289ea11ec17:v228"); Fri, 17 Nov 2023 02:54:27 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f26c036a6ebf4300 X-CR-MTA-TID: 64aa7808 Received: from d0235a4f1486.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0CCA9135-7D28-4EA4-91AF-6B5FA8C04606.1; Fri, 17 Nov 2023 02:54:21 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d0235a4f1486.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 17 Nov 2023 02:54:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n5Uq2PJdk5twpxzHdytIlTYuujZxFo6mY9mPUOOFuKzvoITpBer/8iE/J03IFV3d2m08QoiQQh2rz7SUiK8uj9RRCfHt/fj6RHpr1SH6mQ7r0IvDNiWe+BcUkstVBs+n6P0Im15n6ARisisLmC+uARZZqiZVRSTrXIqNc7e8KumU2g4cq7UMtVM8GCyJ14LtiQwgalN7kvotxnxhkMZw71mK0q+bWUTS0MtBBp2x503Sa5yaYgeTuTyXi7Ew8c05379MK9IryIQI5LEBpUNkK1wYlvQuLALvlCnclrI5QHNi/ge7rATXr+O6L2z5EPzaBBLc/qUNShQFmKqRyWEjOg== 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=u5+mgrXayMqpj6hWtanl6hFOmOo0TqljCyJE463THBw=; b=UyS2nd/COcYgDP0Ay0i1p94qM4V2Pog2xh42ZCcbRunqo8ikuTjbnITVyDTOOdicQSCbLcMcADDJTkQWV5PbDA7zykvJ0Xm8J9FXVv8KZVXzxV6NkLBZ8gIo2OKbvcJc9H023+cmFCDnAq0CMwPmrwDuOqJdfYvqUEVkkXHVS7P5tFJmfKgGwCq6Zfp45PzrGl+81GZmUQ6jJmfwlJEidGb/3O9IvgOT4jdsjF7dAbT9WutkxVDJjKXQ7lNurnR8ssf6e0A+gfUaiAPqULKCtLsC7PnLoR/62D9sFgrJhMVMyG43P7jzV3olB/3F1qKudOahdzHV3LnbjXBI5KTUgg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u5+mgrXayMqpj6hWtanl6hFOmOo0TqljCyJE463THBw=; b=M3tMk+3QYKxiFO950rh8VwPzG9/h1KTFjEqZYos2CBnI2u+4okfhYQnLh1tnhGaLV3seShFCW63LU+r3iNUKtyKN8bleSy47jC/kKqiA8sC+Y6Un9u+ULBkJXHraD1u8jEBvPaVQDZos5GDDA79L8wI70ZATqmWl8qxEkGzK3W8= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6678.eurprd08.prod.outlook.com (2603:10a6:20b:398::8) by AS8PR08MB9409.eurprd08.prod.outlook.com (2603:10a6:20b:5a8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.21; Fri, 17 Nov 2023 02:54:20 +0000 Received: from AS8PR08MB6678.eurprd08.prod.outlook.com ([fe80::af15:c9d7:cd8c:6da2]) by AS8PR08MB6678.eurprd08.prod.outlook.com ([fe80::af15:c9d7:cd8c:6da2%7]) with mapi id 15.20.7002.022; Fri, 17 Nov 2023 02:54:19 +0000 Date: Fri, 17 Nov 2023 02:54:17 +0000 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Cc: ebotcazou@libertysurf.fr, poulhies@adacore.com, rguenther@suse.de, richard.sandiford@arm.com, richard.earnshaw@arm.com Subject: [PATCH v2 3/5] ada: Improve attribute exclusion handling Message-ID: <10532e77-2eb3-5043-0b71-faf415c5a1af@e124511.cambridge.arm.com> References: <88dc78af-82a3-9a9f-4b8e-461c41d296cc@e124511.cambridge.arm.com> Content-Disposition: inline In-Reply-To: <88dc78af-82a3-9a9f-4b8e-461c41d296cc@e124511.cambridge.arm.com> X-ClientProxiedBy: LO2P265CA0490.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:13a::15) To AS8PR08MB6678.eurprd08.prod.outlook.com (2603:10a6:20b:398::8) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6678:EE_|AS8PR08MB9409:EE_|DB5PEPF00014B9A:EE_|AM9PR08MB6260:EE_ X-MS-Office365-Filtering-Correlation-Id: 46454385-c902-4682-fec0-08dbe71883e4 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: S4l96+ucG3Nh3dlgg0OlInDBGyLhCehx2V0KYtKP9qx3yS9ClQzhyR0N1mfVUGN9VxRcWIxsoODS6rro6A4eFTZwSFhCoOuKwiwhW1CetfLyTx2NKRfW8TS1+nueR2vlLauBBIEKqyYKJNSmIzVlPIkbkkECfufg4RhAqZ2gXaX5BAaY2bszPiNr68DfAQsm9vZmFF884nE77/zLIyzvBh1jANCV4Hcc5Su32GadyKMXTvvLyQEPHCsuc3QW7iZmY+GcQZZ8IlMxNrCrnixGtznBbCDavzU4BEXp/iknnmhKITv8LTHOhzYx17Xbr/zRQ+tJZlyu/4G9PyE8rKRVYVfAgRfchRRxKFMNDk2JfVTMdF+5KwYFH37MkjM5/2pbl/nKAJvOu4JLHsXkSJ+KkT2ETblw9hdjoR3z6puTDveA4Hm/9s+B1Hq4zSUvBj1v9nnUGkUsDEU3FNWX4EtsDeC04hFMaegBxJlZj7v2FEJmzerIX459p0AKEopaWZ93HqqqIMrT7xJxyJj3736qVBQ8zFZlfyHVV1b2YvW5GVIojpXFhqVFBJQDKfIvvKl57xeRpurrfxKg0CT+lprPyacW1duXBkrD/7+nvwqrRyLY9dghYFQBWiCnmjakVj672fbCx522ZR3mPivNtumcBFHAYddhmIoqbJHOvUmIvoA= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR08MB6678.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(366004)(39860400002)(376002)(396003)(136003)(230273577357003)(230922051799003)(230173577357003)(1800799009)(186009)(64100799003)(451199024)(2906002)(31686004)(38100700002)(31696002)(86362001)(5660300002)(44832011)(4326008)(41300700001)(8936002)(8676002)(83380400001)(6916009)(6512007)(316002)(26005)(66556008)(66946007)(66476007)(478600001)(6506007)(6486002)(41080700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9409 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5PEPF00014B9A.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 31785fe1-9082-45e8-e689-08dbe7187ef5 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hDjSJX+jLFyuV4aESj1xlHwMHVLBiBbckoLp4NswvNEAs+VcRSKU76mjTh2fxHie1/v9FXrWsgFnSLQ+5WdDPscXLab7ER/RKJFKa4ca5XXpYA801vSWFixTwLyjaw/qJTdhSwhucSupufLc+Pc+1ZibwZL83b5GtKYuZWIkm+2WOdJ0MZPVsnrJ+3Z9SsD8DQs9KMNtSpyWvP7zJTxG/6T3CzhecpULv6NBGLXvZPRq39UR1s/Ylqx6WYjtv3j/5Q6QrNav9sxUSnupmoTzR0BClAsczju0f8SuFy+bu0y6TsRCMl4rJiAsY56/Lc6zNwopJdoxFLTElQwnryyEVOQMwC6xs1wBlUbS+W94sPTVTCg2X2hdcid+Geck6nxUZ5g6mj+Xyn0Ytujll7QWdGj52QpBHYbhqB2/VGgZmMWHm4HjfgzmBL8GTBkp5eb+ybcrzu775sQUtdDKtouS3+ZJRcHvAFOeh5WEYSdLvBqCGMuUjG7dZJwOWzLEefJBC+bgdpXC8oecwL7aYCqCWogjVcZYgUmc1a6C62sSRQd+MagUkhAS1Lps2Vv1CT8w7QTiCtu9y1fYMy34oZItmIL5L/j5bsoc8gjfpOEjveZs4sdj+v0iaz8NdrFPtOoCPwqzMuExfqxkKlU+nag2CYUszgJMD5ZgArR5IZ7afnoT5C7pjYsGbpPyLfcIt2q+UsgmUJfnVoCyMpHnIcNAyhObCHbpmW6X7Q2/yAmCSUusDwQC5hdmMH2syoCjiETLOn7BdZXx6eKDIeB2G4YIms6A/Pt3oVm34vAy8JcTPTE= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230031)(4636009)(136003)(396003)(376002)(39860400002)(346002)(230273577357003)(230173577357003)(230922051799003)(82310400011)(186009)(1800799009)(64100799003)(451199024)(36840700001)(46966006)(40470700004)(31686004)(44832011)(41300700001)(8676002)(8936002)(4326008)(40480700001)(2906002)(5660300002)(316002)(6916009)(70586007)(70206006)(40460700003)(47076005)(86362001)(6486002)(478600001)(26005)(6512007)(6506007)(336012)(356005)(31696002)(81166007)(83380400001)(36860700001)(82740400003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2023 02:54:28.0954 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 46454385-c902-4682-fec0-08dbe71883e4 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5PEPF00014B9A.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6260 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY 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: 1782778116305935039 X-GMAIL-MSGID: 1782778116305935039 Change the handling of some attribute mutual exclusions to use the generic attribute exclusion lists, and fix some asymmetric exclusions by adding the exclusions for always_inline after noinline or target_clones. Aside from the new always_inline exclusions, the only change is functionality is the choice of warning message displayed. All warnings about attribute mutual exclusions now use the same message. --- I haven't manged to test the Ada frontend, but this patch (and the following one) contain only minimal change to functionality, which I have tested by copying the code to the C++ frontend and verifying the behaviour of equivalent changes there. Is this ok to push without further testing? If not, then could someone test this series for me? gcc/ada/ChangeLog: * gcc-interface/utils.cc (attr_noinline_exclusions): New. (attr_always_inline_exclusions): Ditto. (attr_target_exclusions): Ditto. (attr_target_clones_exclusions): Ditto. (gnat_internal_attribute_table): Add new exclusion lists. (handle_noinline_attribute): Remove custom exclusion handling. (handle_target_attribute): Ditto. (handle_target_clones_attribute): Ditto. diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc index 8b2c7f99ef3060603658e438b71a3bfa3ef7f2ac..e33a63948cebdeafc3abcdd539a35141969ad978 100644 --- a/gcc/ada/gcc-interface/utils.cc +++ b/gcc/ada/gcc-interface/utils.cc @@ -130,6 +130,32 @@ static const struct attribute_spec::exclusions attr_stack_protect_exclusions[] = { NULL, false, false, false }, }; +static const struct attribute_spec::exclusions attr_always_inline_exclusions[] = +{ + { "noinline", true, true, true }, + { "target_clones", true, true, true }, + { NULL, false, false, false }, +}; + +static const struct attribute_spec::exclusions attr_noinline_exclusions[] = +{ + { "always_inline", true, true, true }, + { NULL, false, false, false }, +}; + +static const struct attribute_spec::exclusions attr_target_exclusions[] = +{ + { "target_clones", true, true, true }, + { NULL, false, false, false }, +}; + +static const struct attribute_spec::exclusions attr_target_clones_exclusions[] = +{ + { "always_inline", true, true, true }, + { "target", true, true, true }, + { NULL, false, false, false }, +}; + /* Fake handler for attributes we don't properly support, typically because they'd require dragging a lot of the common-c front-end circuitry. */ static tree fake_attribute_handler (tree *, tree, tree, int, bool *); @@ -165,7 +191,7 @@ const struct attribute_spec gnat_internal_attribute_table[] = { "strub", 0, 1, false, true, false, true, handle_strub_attribute, NULL }, { "noinline", 0, 0, true, false, false, false, - handle_noinline_attribute, NULL }, + handle_noinline_attribute, attr_noinline_exclusions }, { "noclone", 0, 0, true, false, false, false, handle_noclone_attribute, NULL }, { "no_icf", 0, 0, true, false, false, false, @@ -175,7 +201,7 @@ const struct attribute_spec gnat_internal_attribute_table[] = { "leaf", 0, 0, true, false, false, false, handle_leaf_attribute, NULL }, { "always_inline",0, 0, true, false, false, false, - handle_always_inline_attribute, NULL }, + handle_always_inline_attribute, attr_always_inline_exclusions }, { "malloc", 0, 0, true, false, false, false, handle_malloc_attribute, NULL }, { "type generic", 0, 0, false, true, true, false, @@ -192,9 +218,9 @@ const struct attribute_spec gnat_internal_attribute_table[] = { "simd", 0, 1, true, false, false, false, handle_simd_attribute, NULL }, { "target", 1, -1, true, false, false, false, - handle_target_attribute, NULL }, + handle_target_attribute, attr_target_exclusions }, { "target_clones",1, -1, true, false, false, false, - handle_target_clones_attribute, NULL }, + handle_target_clones_attribute, attr_target_clones_exclusions }, { "vector_size", 1, 1, false, true, false, false, handle_vector_size_attribute, NULL }, @@ -6742,16 +6768,7 @@ handle_noinline_attribute (tree *node, tree name, int ARG_UNUSED (flags), bool *no_add_attrs) { if (TREE_CODE (*node) == FUNCTION_DECL) - { - if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (*node))) - { - warning (OPT_Wattributes, "%qE attribute ignored due to conflict " - "with attribute %qs", name, "always_inline"); - *no_add_attrs = true; - } - else - DECL_UNINLINABLE (*node) = 1; - } + DECL_UNINLINABLE (*node) = 1; else { warning (OPT_Wattributes, "%qE attribute ignored", name); @@ -7050,12 +7067,6 @@ handle_target_attribute (tree *node, tree name, tree args, int flags, warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; } - else if (lookup_attribute ("target_clones", DECL_ATTRIBUTES (*node))) - { - warning (OPT_Wattributes, "%qE attribute ignored due to conflict " - "with %qs attribute", name, "target_clones"); - *no_add_attrs = true; - } else if (!targetm.target_option.valid_attribute_p (*node, name, args, flags)) *no_add_attrs = true; @@ -7083,23 +7094,8 @@ handle_target_clones_attribute (tree *node, tree name, tree ARG_UNUSED (args), { /* Ensure we have a function type. */ if (TREE_CODE (*node) == FUNCTION_DECL) - { - if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (*node))) - { - warning (OPT_Wattributes, "%qE attribute ignored due to conflict " - "with %qs attribute", name, "always_inline"); - *no_add_attrs = true; - } - else if (lookup_attribute ("target", DECL_ATTRIBUTES (*node))) - { - warning (OPT_Wattributes, "%qE attribute ignored due to conflict " - "with %qs attribute", name, "target"); - *no_add_attrs = true; - } - else - /* Do not inline functions with multiple clone targets. */ - DECL_UNINLINABLE (*node) = 1; - } + /* Do not inline functions with multiple clone targets. */ + DECL_UNINLINABLE (*node) = 1; else { warning (OPT_Wattributes, "%qE attribute ignored", name);