From patchwork Thu Nov 2 16:38:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Do Nascimento X-Patchwork-Id: 1858614 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=eHHqSa1i; 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=eHHqSa1i; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; 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 [8.43.85.97]) (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 4SLqNJ4Sflz1yQ5 for ; Fri, 3 Nov 2023 03:39:39 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 81CAE3857353 for ; Thu, 2 Nov 2023 16:39:37 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2086.outbound.protection.outlook.com [40.107.241.86]) by sourceware.org (Postfix) with ESMTPS id CC46E3858C60 for ; Thu, 2 Nov 2023 16:39:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CC46E3858C60 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 CC46E3858C60 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.241.86 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1698943163; cv=pass; b=xFP1pic8pK4ORzeUV75dqFu4RjNW9lI5kPbYt/yXtHeyOWk302V553wBLHxkOFXsbFiFGQ+lAoOpZrJRazpWVuXTuepx3BrLW6HAgEcID28GBm5Y7QB2/UatXr658B9zqHrbLj88jFXa6cmt/OgOOC9OgaGgA5hW2k0NnFQX6PY= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1698943163; c=relaxed/simple; bh=HT82QsDL7ZHy7HIrU2d+rSpJEbc2cDa+b9qYMCRgub8=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=VvOpwOY53C/g0hqsodmOCR6Ar7/XdrUsEpVoVWfQQl9fNx11/ptp8sZ8izzLoRbAqEewgRmQ5MTY5LOIQRuwQyhzwqlbTZcsZwR3hJDmvjJpkeYf8QgHj1gP/Obb9XT+r8JXq2xTeJql3J/wuBNKkLtM2u0hBoIUAQn2VRg61Bg= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=K4/Obud/jt33TdsqikyvsFah81UBTrUYZsO49X0vA9pp6ylF0chk9sNiXUShJSwF1llDizyw67jIjzCfItfN37anypipIHwqW6XFdg98iMpxppwNVjk1y/FdOQnowf2ZdgCVV+uRdBzBan6SC4LCkvesjP7ekvRrGS59dVeqPohr/S+p0VtRUNA6aT1tFD0DOeHQTuYvFTXspVHv/4Z58+j3zUwGrkfNZ+W3SbzbWHTgjUkQ/bu7MqVHFBgKJw4qEmk5MOYwpZF/EJE5Jo1DnNSEUUeMQ37v7Rg3Nb2sxjajpqjtybJA9dmxhSBFUSLJNIZ6NuRhHDs7FPK2W/Kw7w== 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=Lwq14kPrrcLkAp2DnY2gpjMTAh0a8ZnTqrKiZCr1zLY=; b=SXJzN8t6pqR7umqHRC0pbnF12CrZ2BclVImH8AJJkOLfa+rhturVPeOkiuC7ogl/MfIaLFDIC2e+DZYCRM036odiJnfk28Ehn6V2jSsdMu6xtA3P0OAHoheTuSh+P24PjxbFVyIpte+mLyBx2BtOamqkF3eko07mere52PTEvQr1QKdY85HPYkr4sfemSHhIljEWVrffEbMBjdH5/cu4+LTNhN8z4DPjJgpic/9pi82/+OQmVM77gJvD3yCTbH+7KfcbqiIjd8QGRmg38eewqf60O7/BR523eMBEDoYGUbn2UL4QbEPlxSTxv5L9z7xPEEkxgpjZdU+mu2X0nRAXRw== 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] 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=Lwq14kPrrcLkAp2DnY2gpjMTAh0a8ZnTqrKiZCr1zLY=; b=eHHqSa1iDBhDerBlrir7ttj7mzTywIa6b1ae6bVfid7sEoELbT1+JLkP83Ad4pMTj9pU7vRBrmKOthlC27U6s8CdwqznssuG6fan299zjuVmx/9s3ps6+P8d9vHEEPGb53Zo6x3/sn1PZukZjJKnsw/hIwides8I/gh5dfaHym8= Received: from DB8P191CA0006.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::16) by PA6PR08MB10782.eurprd08.prod.outlook.com (2603:10a6:102:3d0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19; Thu, 2 Nov 2023 16:39:14 +0000 Received: from DU6PEPF00009529.eurprd02.prod.outlook.com (2603:10a6:10:130:cafe::ed) by DB8P191CA0006.outlook.office365.com (2603:10a6:10:130::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21 via Frontend Transport; Thu, 2 Nov 2023 16:39:14 +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 DU6PEPF00009529.mail.protection.outlook.com (10.167.8.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19 via Frontend Transport; Thu, 2 Nov 2023 16:39:13 +0000 Received: ("Tessian outbound e243565b0037:v228"); Thu, 02 Nov 2023 16:39:13 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a91ab8e1a87c5724 X-CR-MTA-TID: 64aa7808 Received: from d2a6e73a5c86.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B9DD8651-38E8-40C1-AA97-A503C707B2BF.1; Thu, 02 Nov 2023 16:39:06 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d2a6e73a5c86.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 02 Nov 2023 16:39:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FnxCCT/5uBbXF+ikzK2Qv0K0XxiWXSCuVhDCs6OSb8oxgX7thO0wTyRNX26TBoeedASM+hf2we+3qXkIX7FbFC7uKvP0dyfTbBY8wqqTxs8CtOH6bdJsSHBud2NfIXAl1xHNvdfunmu4otR2ke1I/bs7S9EUrd5HJ9UarNJBb6V8tcjSGxWfGaM0H2HNxTiqgCa46qnVMUrsXF9eSGXHI5hhHkQ8zeTMOjpxw6inch9pPBvPctgHPQJoX2o2zFkgk/cn4RO4aKETBTJrgkSLZOTAGgNQXFv9gG8ZTuAN8UJ4DpCWS1RyAGEz+zb83pyrdgPq0LaTs2uCthzUETp7zg== 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=Lwq14kPrrcLkAp2DnY2gpjMTAh0a8ZnTqrKiZCr1zLY=; b=LlM+XTsiW/skl+hXpWCqL0sm3W7fjfD2cfZrZ2EqlEsXWsKKsi50CChf+Y7fJUqrVa0Ixf6ff+QCsQuJJuU88dN7PgYg/f5IK0LqbpYufKsnWnYVCeUHbvbupjDQZi721B7++sODQ66YGR8MhmH2RxOz+a5pNrsx05KtSmC4huN0Av4qigNYzfh0LnPXPNJJQ/LbbHJ7IPCUI6bzBtb4Oc0IrSjGTVPWlVVzfA9o05bWsdHVmpq3i9Gi7vJ9Gxl2NSPcfBwGuy5k2Z1MqC9tow3eLdk0TDBSSHh/dNIo6IvW3d66tP+h3MqhVmRWZED0BiyjY5SESGlAiC8npHdC9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none (0) 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=Lwq14kPrrcLkAp2DnY2gpjMTAh0a8ZnTqrKiZCr1zLY=; b=eHHqSa1iDBhDerBlrir7ttj7mzTywIa6b1ae6bVfid7sEoELbT1+JLkP83Ad4pMTj9pU7vRBrmKOthlC27U6s8CdwqznssuG6fan299zjuVmx/9s3ps6+P8d9vHEEPGb53Zo6x3/sn1PZukZjJKnsw/hIwides8I/gh5dfaHym8= Received: from AS8PR04CA0184.eurprd04.prod.outlook.com (2603:10a6:20b:2f3::9) by DB3PR08MB9036.eurprd08.prod.outlook.com (2603:10a6:10:435::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.29; Thu, 2 Nov 2023 16:39:04 +0000 Received: from AMS0EPF00000195.eurprd05.prod.outlook.com (2603:10a6:20b:2f3:cafe::39) by AS8PR04CA0184.outlook.office365.com (2603:10a6:20b:2f3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21 via Frontend Transport; Thu, 2 Nov 2023 16:39:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AMS0EPF00000195.mail.protection.outlook.com (10.167.16.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6954.19 via Frontend Transport; Thu, 2 Nov 2023 16:39:04 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Thu, 2 Nov 2023 16:38:59 +0000 Received: from e125768.cambridge.arm.com (10.2.78.50) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Thu, 2 Nov 2023 16:38:59 +0000 From: Victor Do Nascimento To: CC: , , , Victor Do Nascimento Subject: [PATCH V3 5/6] aarch64: Add front-end argument type checking for target builtins Date: Thu, 2 Nov 2023 16:38:33 +0000 Message-ID: <20231102163852.1860658-6-victor.donascimento@arm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102163852.1860658-1-victor.donascimento@arm.com> References: <20231102163852.1860658-1-victor.donascimento@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS0EPF00000195:EE_|DB3PR08MB9036:EE_|DU6PEPF00009529:EE_|PA6PR08MB10782:EE_ X-MS-Office365-Filtering-Correlation-Id: 57202851-323a-4492-015b-08dbdbc23f81 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: B8+47uTFtDesd9hP1zhJm/19/sXHI1XcAI6qb3ELeVFmgmi/UHvia1QfoUob+MHed6bIwTp9m/hwbJ/fEp+pm6j82kgsK23JQnI7kruBYGEV/WyNE51YYTmxjXwrI3v1j/+LbfkxfbIhZjY6YuZBJhQcQO76CO/clVPPjnEQTzaTqaXVz3utuMz6diWT/nDuV9Ol8VoWDxcOY6O2IKvtmMuC6Zdrr/SdZC3+HcxLpIM6C4FIhpAp2zM8/yH3Uc67ew/8vbtAdYCnTkEHHGzsqoV+ji7vOJSm7E+FXbblRw004legKO7Msfzwx09cGcDt+xgt5p0oSbC8fLcB76OGLrlj/zjXrCqyDNjZ0bVeOINcZBZ5RqR7Lgx2uRgUGwrX8rjhKTl/iLLJNCIvBu+OxPw/ELucdWXewAwhfhg90M2i9XNS+uXusIVB23elqcJ3feYuRMlnt0f1NjFdy4TCZoeDQfGmUXUcBsJa0lMdc+m468Rk7jwUtauYTPe6r8cHVJ4TOId3ilK3iMNpzc7oqPmRBYeP/gPLd3s8hue/TfGpiybr5dKB8dBKrp0XvdqNAXVb5gybN46i3+CIx6AZy1olO6D5YdQniucmGiuvEyrQE2pQ6J8jKj1aAK8xZKKw7+IlBeDcI1cS0EM04GWQrPIPOPXeOVh6NTFWmCOcXJNWdVBG5oLb7B8qRnjXloIYzT9YqWc+ifuSZ0rd22giM00qc+bCgC8kgHoiWbPuXrv0oIO8+sFQabmtqwPWpGPvbXPkwFw6FZ8Q87+hwjqAPg== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(136003)(376002)(396003)(346002)(39860400002)(230922051799003)(186009)(64100799003)(1800799009)(82310400011)(451199024)(46966006)(40470700004)(36840700001)(40460700003)(1076003)(2616005)(26005)(7696005)(356005)(82740400003)(47076005)(81166007)(36756003)(86362001)(426003)(83380400001)(36860700001)(336012)(84970400001)(8676002)(2906002)(4326008)(8936002)(5660300002)(6916009)(70586007)(70206006)(54906003)(316002)(40480700001)(478600001)(6666004)(41300700001)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB9036 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU6PEPF00009529.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 7ee18c0f-ca3e-47a7-9977-08dbdbc23a00 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qM+HkF0VDN/phxEOHAwqw5otgAXsm0pOfEGYtb95PxHHjcU4lROXFjudVvz8JGGuDByqfkhckF6sR3nAOEDx9B9Y3/EcD4EPcEDagM6eOuMEo5WhklHy9QVBDazEpEzyqCP+Wi96yB+WaPhNNGKtyV33RvJXjx6h9qxmf6RmV+j6yNAN+F0yuliN6KdPRdiNsgNi7SQGEjvuY4gCRkQvCPD2fzgsnpAEATpYDVYo1rwysBUOB4WDX4WxEDs5o1bC7H8xyUrpMVmRbKZJKZp44Giqyqwz8XkrYRsyZTj9xp6M8RusfTnUc8Nmr0RlQ1xsMtWDazYlGaIbsxNWoDanYU0tBrRS8DoQyivuLBfmE4tO3Q+G0yHCeqDMN1xFOZslcvc6bMd8xGXAQ1R8o4XESKMtLU4Cc0udu+3nygs31MKBV2kr1ag1ecrqeGq3YbSi4YYMaHCidst0RHGnuNGVd2E1eM+Pt11QU/RE4tN6omxzFa+CytSI9XSe4J60RNSes0PxvoQ8Kih19IOm/pP+sevraGW9YRR3oTUuB3JqUPgWphPbkSxN2C5UHGUrlDgHssts4VNgVrZgUc9j0jnW24S99R+TrxuNHtQpO3TuogQao9ff30jxmjsKQmrqyDxZY87oOoCyl0ZugdQYeQaeoxP0IdlBrVZlmuDqpdZSvMriV/77+0waaRI0owFuJN25MZ/zsD9zoCUmGw4C35HodbWCy38SHBNKdC4r5vi640M= 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)(346002)(376002)(39860400002)(230922051799003)(451199024)(186009)(64100799003)(82310400011)(1800799009)(40470700004)(46966006)(36840700001)(2906002)(40480700001)(40460700003)(2616005)(26005)(47076005)(41300700001)(1076003)(478600001)(7696005)(336012)(8676002)(36860700001)(6666004)(83380400001)(5660300002)(70206006)(4326008)(316002)(54906003)(70586007)(426003)(6916009)(8936002)(86362001)(81166007)(82740400003)(36756003)(84970400001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2023 16:39:13.8614 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 57202851-323a-4492-015b-08dbdbc23f81 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: DU6PEPF00009529.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA6PR08MB10782 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, KAM_SHORT, 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 In implementing the ACLE read/write system register builtins it was observed that leaving argument type checking to be done at expand-time meant that poorly-formed function calls were being "fixed" by certain optimization passes, meaning bad code wasn't being properly picked up in checking. Example: const char *regname = "amcgcr_el0"; long long a = __builtin_aarch64_rsr64 (regname); is reduced by the ccp1 pass to long long a = __builtin_aarch64_rsr64 ("amcgcr_el0"); As these functions require an argument of STRING_CST type, there needs to be a check carried out by the front-end capable of picking this up. The introduced `check_general_builtin_call' function will be called by the TARGET_CHECK_BUILTIN_CALL hook whenever a call to a builtin belonging to the AARCH64_BUILTIN_GENERAL category is encountered, carrying out any appropriate checks associated with a particular builtin function code. gcc/ChangeLog: * config/aarch64/aarch64-builtins.cc (check_general_builtin_call): New. * config/aarch64/aarch64-c.cc (aarch64_check_builtin_call): Add check_general_builtin_call call. * config/aarch64/aarch64-protos.h (check_general_builtin_call): New. gcc/testsuite/ChangeLog: * gcc.target/aarch64/acle/rwsr-3.c: New. --- gcc/config/aarch64/aarch64-builtins.cc | 31 +++++++++++++++++++ gcc/config/aarch64/aarch64-c.cc | 4 +-- gcc/config/aarch64/aarch64-protos.h | 4 +++ .../gcc.target/aarch64/acle/rwsr-3.c | 18 +++++++++++ 4 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/aarch64/acle/rwsr-3.c diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc index dd76cca611b..c5f20f68bca 100644 --- a/gcc/config/aarch64/aarch64-builtins.cc +++ b/gcc/config/aarch64/aarch64-builtins.cc @@ -2127,6 +2127,37 @@ aarch64_general_builtin_decl (unsigned code, bool) return aarch64_builtin_decls[code]; } +bool +aarch64_check_general_builtin_call (location_t location, vec, + unsigned int code, tree fndecl, + unsigned int nargs ATTRIBUTE_UNUSED, tree *args) +{ + switch (code) + { + case AARCH64_RSR: + case AARCH64_RSRP: + case AARCH64_RSR64: + case AARCH64_RSRF: + case AARCH64_RSRF64: + case AARCH64_WSR: + case AARCH64_WSRP: + case AARCH64_WSR64: + case AARCH64_WSRF: + case AARCH64_WSRF64: + if (TREE_CODE (args[0]) != NOP_EXPR + || TREE_CODE (TREE_TYPE (args[0])) != POINTER_TYPE + || (TREE_CODE (TREE_OPERAND (TREE_OPERAND (args[0], 0) , 0)) + != STRING_CST)) + { + error_at (location, "first argument to %qD must be a string literal", + fndecl); + return false; + } + } + /* Default behavior. */ + return true; +} + typedef enum { SIMD_ARG_COPY_TO_REG, diff --git a/gcc/config/aarch64/aarch64-c.cc b/gcc/config/aarch64/aarch64-c.cc index ab8844f6049..be8b7236cf9 100644 --- a/gcc/config/aarch64/aarch64-c.cc +++ b/gcc/config/aarch64/aarch64-c.cc @@ -339,8 +339,8 @@ aarch64_check_builtin_call (location_t loc, vec arg_loc, switch (code & AARCH64_BUILTIN_CLASS) { case AARCH64_BUILTIN_GENERAL: - return true; - + return aarch64_check_general_builtin_call (loc, arg_loc, subcode, + orig_fndecl, nargs, args); case AARCH64_BUILTIN_SVE: return aarch64_sve::check_builtin_call (loc, arg_loc, subcode, orig_fndecl, nargs, args); diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index 5d6a1e75700..dbd486cfea4 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -990,6 +990,10 @@ tree aarch64_general_builtin_rsqrt (unsigned int); void handle_arm_acle_h (void); void handle_arm_neon_h (void); +bool aarch64_check_general_builtin_call (location_t, vec, + unsigned int, tree, unsigned int, + tree *); + namespace aarch64_sve { void init_builtins (); void handle_arm_sve_h (); diff --git a/gcc/testsuite/gcc.target/aarch64/acle/rwsr-3.c b/gcc/testsuite/gcc.target/aarch64/acle/rwsr-3.c new file mode 100644 index 00000000000..17038fefbf6 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/acle/rwsr-3.c @@ -0,0 +1,18 @@ +/* Test the __arm_[r,w]sr ACLE intrinsics family. */ +/* Ensure that illegal behavior is rejected by the compiler. */ + +/* { dg-do compile } */ +/* { dg-options "-std=c2x -O3 -march=armv8.4-a" } */ + +#include + +void +test_non_const_sysreg_name () +{ + const char *regname = "trcseqstr"; + long long a = __arm_rsr64 (regname); /* { dg-error "first argument to '__builtin_aarch64_rsr64' must be a string literal" } */ + __arm_wsr64 (regname, a); /* { dg-error "first argument to '__builtin_aarch64_wsr64' must be a string literal" } */ + + long long b = __arm_rsr64(nullptr); /* { dg-error "first argument to '__builtin_aarch64_rsr64' must be a string literal" } */ + __arm_wsr64(nullptr, b); /* { dg-error "first argument to '__builtin_aarch64_wsr64' must be a string literal" } */ +}