From patchwork Wed Dec 6 12:45:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Carlotti X-Patchwork-Id: 1872753 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=F+Ax/tko; dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=F+Ax/tko; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SlcZW33HXz23mf for ; Wed, 6 Dec 2023 23:45:39 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4D8A33858033 for ; Wed, 6 Dec 2023 12:45:37 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2080.outbound.protection.outlook.com [40.107.15.80]) by sourceware.org (Postfix) with ESMTPS id 56B463857C5E for ; Wed, 6 Dec 2023 12:45:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 56B463857C5E 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 56B463857C5E Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.15.80 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1701866725; cv=pass; b=os/yJNr+KAhjsFYI0IBb07gml7r2MtE0hpPq7JwbcZRX0A+cNfmtr0h3pV0NS0zclrZNpY2UfcTuz5rawc19M/N1HgXo/ZA0K6alZukTvMBJ/NWY4PSfp8K7tOlZO1RgUy0f1OWAn9SZZJFcmejA0VCPFPaC0rFx5boVZUa2vgU= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1701866725; c=relaxed/simple; bh=TGBh48yzgpLWabHDh0b9zBC4NshgG8QHo2N3ZYz2aEc=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=LFUl6PS4/W3DdfwAQKP5IOK7PcHQYkRZTKIaXasnI6QibEI8em+6++ev21U1lkJSE88pOIASb7n+fkv1melzp0sfL1S2CLz1OIQKQmzYhdITz5uSBT26VfmCEPK9Kta/uRwFa2+h4k95/a1LTTsr6i1iMiMtB9iu7KN+kcuaAGI= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=KYWhkUCGHLBgO5QQ58nG2U4orpRLUe4lui3tdmQTB0KAl7SFubCoxSQZ87dkQ8NxudF2uXSxv7w9LBzmQ6vdjLn3H8cq/k8Ur6pHaEqroUBW6CqM4H5j4ZCZVGkRr9ENOl4n1ApFBQlbS5+3vCFHHaWrgcAW1ZeZhLs9hEPXL4ZKo9NSjwMPGbsVZ4YcBc5JAyeaYV8DUrbqgn+YkVrNUictXExs5CWNpkr+gEnwZHHsca6DLjxXXuyxmm/IvTgUWUxJ7lBFiUp4I5ZtgdtsdMsXycpLK15JHodDEhgV4KYO+POKWOj4FDp3t67tHmSo4IkISMER679ibN0He89sXw== 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=372xekdVKg0hXJjPrYd5F8hY/YlswwvtaljyHAaQAhE=; b=CUVLjTgnhIkqqMB5pQ/nrFkosKOK5Dadb6lgitpAocgqbJxw8mA5iBbYd7wGjWoIeKssFNlU8SuKJys70CeqBhW44NJ8zhcMD0OToTESEhGrTXlY3WnR4Z37fVM/tlosu74GQ+WiP2sbr9SAgHDBfbD7wBoB3GBNZ6ngbB5ygw0TfYi7mQXG2txWozg1d0DfvFc7yZ81+BTE/JC1qvchZkxKsrvpU6u9GGcu9wB/FdKP/YVBrAwMSGOYnvaDHqWyqSGZfyJJ50Zp2ux9hy3SdSgFbagkawCW4sVN36pns29z6e8dc0tguAdAEtHxhzcD/hN/MddXOL4380W4AIHIbA== 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=372xekdVKg0hXJjPrYd5F8hY/YlswwvtaljyHAaQAhE=; b=F+Ax/tkofmcjzTWPhehAfTPVAJnguEz199PXDXHe8J1cDU2w9+Dm7Fq1LDRdzrWzncHMxzLBwpwOkrLI85JDZYEtlMcpVJCN6FbXFUWgehCRgX5KZ1CXvvSvE6J8OpJll8+0z2n1z6tXCr0FGCxP4R9T5yDx2pLcUIRS3DItkQ8= Received: from AM5PR1001CA0010.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:2::23) by AS2PR08MB8455.eurprd08.prod.outlook.com (2603:10a6:20b:55b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.25; Wed, 6 Dec 2023 12:45:20 +0000 Received: from AMS1EPF0000004A.eurprd04.prod.outlook.com (2603:10a6:206:2:cafe::c) by AM5PR1001CA0010.outlook.office365.com (2603:10a6:206:2::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34 via Frontend Transport; Wed, 6 Dec 2023 12:45:20 +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 AMS1EPF0000004A.mail.protection.outlook.com (10.167.16.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.20 via Frontend Transport; Wed, 6 Dec 2023 12:45:20 +0000 Received: ("Tessian outbound 7671e7ddc218:v228"); Wed, 06 Dec 2023 12:45:20 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 6507c72961bcd3b1 X-CR-MTA-TID: 64aa7808 Received: from 4fdeac60adff.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 390E9E7B-34F6-457F-BB25-DEDFBB10C551.1; Wed, 06 Dec 2023 12:45:13 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4fdeac60adff.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 06 Dec 2023 12:45:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ihTjTvMQjSGtimbNJOU73zUkq5GWf+nYVcgCRDXz272ljHI+7kAiuJEyGKpJKuH/egbO9VvqoYbcZ2D6wOV4wOI5hdZq51gQ6nAwp1J3jNgXc0XLcGsQLcrJDGzQ92UL+c9PLQUR6VX5qarzuJJ905nqiMGAG3QKjZN2XJm+qJoRj6JICj4YduuDpmikpBoedasV5DTKwGlXjMKOJPCW5gnzt6CbXW71hQwye2/pJb6i/MxQg8vx+1QbOJCZa/nlio0fqcjpadXi1/iSGRly18BP4ddleOPSrujLeMNKqxRQqIGJHa9tOs+m1mVan48n+QFbyi9Vo0/5LCSgLQRLXQ== 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=372xekdVKg0hXJjPrYd5F8hY/YlswwvtaljyHAaQAhE=; b=ijexhr8GIqe2lKqnN5TtE9CpZjpYzEkfg+QOKw8gRYcrzCpauBkz+KaaAi+5wRq9fEm3xtG0T/86FhqkAwUpRmzQfQ0gaC5v9SkJEe3NcetmSELNzFvyT5TKf3Aq7llI/LJ/9iQUN2WTIVTXUs/M0BYdyAsciNxGPhG56v87QlZfs949Lz9hpj0BP7TbwiNMdpkaczuZCJkQr4BwUaNB46Oxp4UPoW4I+QV0DIudm3nUr1jSo1u41MYpXO1MMo69hLiALCSXJEjUe+7IOWNZkjwAocfToeRuN1NSqWYxBISJyfHJ0b/NTVSwOhC/0JfLfQDRyNScx5UjUUkn/Bl2Jw== 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=372xekdVKg0hXJjPrYd5F8hY/YlswwvtaljyHAaQAhE=; b=F+Ax/tkofmcjzTWPhehAfTPVAJnguEz199PXDXHe8J1cDU2w9+Dm7Fq1LDRdzrWzncHMxzLBwpwOkrLI85JDZYEtlMcpVJCN6FbXFUWgehCRgX5KZ1CXvvSvE6J8OpJll8+0z2n1z6tXCr0FGCxP4R9T5yDx2pLcUIRS3DItkQ8= 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 AS8PR08MB5942.eurprd08.prod.outlook.com (2603:10a6:20b:29f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.25; Wed, 6 Dec 2023 12:45:11 +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.7068.025; Wed, 6 Dec 2023 12:45:11 +0000 Date: Wed, 6 Dec 2023 12:45:08 +0000 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Subject: [PATCH v3 2/5] c-family: Simplify attribute exclusion handling Message-ID: <53309896-3cb3-e114-7471-a2f320464bef@e124511.cambridge.arm.com> References: <4cdd7089-edd4-96b9-5c0e-120d5357f01b@e124511.cambridge.arm.com> Content-Disposition: inline In-Reply-To: <4cdd7089-edd4-96b9-5c0e-120d5357f01b@e124511.cambridge.arm.com> X-ClientProxiedBy: LO2P265CA0169.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a::13) To AS8PR08MB6678.eurprd08.prod.outlook.com (2603:10a6:20b:398::8) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6678:EE_|AS8PR08MB5942:EE_|AMS1EPF0000004A:EE_|AS2PR08MB8455:EE_ X-MS-Office365-Filtering-Correlation-Id: 1af40304-c072-4e86-8c30-08dbf6593506 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: TgUgVBsoM24TdwOPDLfXvByoyJ4nzfG9nNhHIsC88t2d5qQBlvS7orZVGVopJA768ljz429+bjbXRwT9s6h3NgFivEani2f1QQoDrDbss9pAC6sVEXJxIdL6byCnaZEXrfrH5bMQufaBcWSQBEGqXjX5dacdn8eWPzveTCy4E/9ivMEjPB5g2MbuVndJoZmXw3YRDfd1bi7Kl+XyBsIRSQWozaof7CmiadX+j1ZuUTNuxWsAY1NfVS5lmwTRMQbj1ClHOIZ4l5G8I4uZ7MZeK3ZdneYpds0UJd35suWjlwyQ/fU742pIJNwAy9yNOJMPcDmURz7ZTQypmYK6XAS5k9sNc0XazB1Ejl8TB9vxXeRJCJGKeghV1pjupY3A6phQUlAyxflidvwpMoD9LE83Dm3EVX7lFWuXLE/9/3ImZ1ZAtGliR62fGNfR0mR1EtRLJoyPVehs5/bSJ4odss+FiCJXDWPZ7t7x52T0VFX0dvQbYlO85qqxkZyszVmRgLHEFeHe+5//sFJR8WQL88V9swsI2Cwtc6vvYJQlZBwEGaMo0W1pxp9QxEnqm1BokhTFor/whxcvhAilE15DYDw3qL+/z3t0XkqJw4pArZlXPdmKxy9JtlyzrB43Y0p81+Ze 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)(136003)(39860400002)(346002)(376002)(366004)(396003)(230273577357003)(230173577357003)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(5660300002)(44832011)(6506007)(6666004)(86362001)(8676002)(8936002)(31696002)(41300700001)(38100700002)(31686004)(2906002)(6512007)(26005)(83380400001)(478600001)(316002)(66556008)(66946007)(6916009)(66476007)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB5942 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: AMS1EPF0000004A.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6666a8ab-a24c-468d-cd16-08dbf6592f6c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Pat/PAfLOk3Xi9j9Xfy8oKumcTKLPvzHRcRi0tumcvmCKeSRHAn9+J6OXCC/PrFDCwBnq2k0y+s65dUYJHlG1Nmh+jd52gPrBTtNBBWCw169Kcq3zZFoJANVF7KFUN0gg81HhTEuH3JtkAi8IYSrRkq9KKh1crb5SqdOqajC9z2RWI0K/MZwMitj0UmPqCIXgGjHraLkn83G3K3hiQzmrfQIAKTe3DrVw3QeHpF2QoxNmCFrVF0ud7nlSIk+BfAc49Xkc+edouahK70Tw1SaEXnZk+7cri3q8zH6ohoriC88I071g9d6AUGFgO1pRatQC1aJxXqON6fCM7gQEzzfrXZwoqqj5IA0lCOssSiqSJSt1LJmdFGgmxEjO2FDpVQru2TzOOjPlR+FlsYFH5YcshyNI9kaQ8Bv+KreJZHsxLkyDySHYJ8RWDgUs4YyE0aIOB8h1LsDdIjR0K1qSgAVYE2+yOM2Yq9HM8aUeA488uwwyZJMcD/XEJ2gW6xeha15wY5HNAGWcbpOBvcEAmWGSy/K6S6Z/ktm7GYPWLPKUCq/ljEKCejxbrpNv9wPo/0JNHchQrDjg5WO4NOCCiyEhIhQiuuPYpk0EdqSiFJ4onRMCj4jsEQtMGL/SQ3RF3T0CeDnvkb4FFAhTSNIqYy0E5EO0Cdcj4HSiGUMogVo63hzajxbPxHGX5MMr0q9MABqdD6wUr51nDvTLCXyJA0+wpH7nFjeIkjQtc6bPF1B6IJynTknCCatRZcFbHPtIiCR0wv20rRCfOiXzCSbSrfHVK7CXjnBcnwVYRsLwAEiMj0= 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)(396003)(39860400002)(346002)(136003)(230922051799003)(230273577357003)(230173577357003)(451199024)(64100799003)(82310400011)(1800799012)(186009)(40470700004)(36840700001)(46966006)(478600001)(356005)(31686004)(81166007)(82740400003)(6666004)(6486002)(40480700001)(36860700001)(47076005)(83380400001)(40460700003)(6506007)(6512007)(8676002)(8936002)(2906002)(5660300002)(31696002)(86362001)(41300700001)(44832011)(6916009)(70206006)(70586007)(316002)(336012)(26005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 12:45:20.4575 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1af40304-c072-4e86-8c30-08dbf6593506 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: AMS1EPF0000004A.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8455 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+incoming=patchwork.ozlabs.org@gcc.gnu.org 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. 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'" } */