From patchwork Tue Aug 6 14:07:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Longo X-Patchwork-Id: 95380 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8640D385C6C6 for ; Tue, 6 Aug 2024 14:09:11 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2613::601]) by sourceware.org (Postfix) with ESMTPS id 8A8B03858294 for ; Tue, 6 Aug 2024 14:08:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A8B03858294 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 8A8B03858294 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2613::601 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1722953317; cv=pass; b=GNV3DeaF4NWcpB2+ev7+2dOlKa3umAr0cy865Ilsr5bp0dDUnMJ7O5jHUXmKy8TOZ+h1pSFmBC4wvklHqhUa0Q18+pdderRGn8jQnqd6T8craFOLTR6SJ1+IuOA99NC3ZJY6OMVqRStViivSvUn9vs0AOv3VPc9QiSOolPnfJV0= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1722953317; c=relaxed/simple; bh=Nzq0S8LqpSWsZ/uaMYcvzKewvz8ElEyqnR3f1IrQEqo=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=hMl/Ks2UnavI6yL/rceBFrwmmgqrGq3sYPOySAsbDz5pSzOW7YUweaw0PT/kkCiTweETJ0SKGd5jHnGCj7Ikq/T49tWZpEhIaf1o/Is6O1DkBnyfW7z/V+Xuy/yioB0sEERRt2brNY2b22wzSM6KiyH9EKVbuXFPfBBTAcLJw0E= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=q07AEEfROSwY6XrC3UASc6v03gqKAfjHZNic++rUhzkSHWoF8KrGPJXjbewCGlGfIIiZI85WmVbmXBIjY81w53vcY80SymRsF56mdZN4juGRz4jhmRS6B6vsCJFEaHqIcQSR673EJBDUO7MUackBCgs7RwBgUj5AkXI8LD9nI/uSpMcxcGjpH5cUxz7gtGyx/PWh3vKkIWIaiBjEVf+a0r0ijGYc9xas0P2D+wP+z0tHaMKITAJ4SN/nk4TwDpjGg8aaGpj3qOFUzsHQg7o9FEWSAt3JVpV4IxXs3a36Sq2hpB0LjA1s1EVHp5B0rSFRq0e8e4tb+l4srzFaTYug9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=I+0JAaCkbnQViYnmGyIXNEsjTNvy7ATDOgSVV7q3SSU=; b=aIprwpfUCEt5yf+dLqcbvywbOgyipTIl88zIzUjcZtoZC0yb3yxgU1NmXev9lPkkXBPrx6pDlXyseOQP4SvYuGxYk6i2Jc0PE7C9IpMEy91L2xGzRM0prCHuNEIoCBclgZTiuLSRetgMVFRZKsfmYxoOkkoMuKyw8I11a2F6uciLJxL6OrqYDqvmVYvAe+XrAYXhfKW0rVJYdy6uXfKwWAsUci9u14Uf5qzYRmvmHboqWhtJJbzQf+RGWq8TzXVXRxtKWA4aErHfIK3P8OZqbR3EPmVtqUIBSBiDeZNYRK1oXvwmN8OuofJ5a+NJZVu9/UTz2n1Qf5wizYdnc0O8gg== 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=arm.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=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I+0JAaCkbnQViYnmGyIXNEsjTNvy7ATDOgSVV7q3SSU=; b=W0isGiMvpTl4JAVZxKA1+UvFs6lFJdZN+recP1gv1t5mEnl2XwEWBSjCnt9KXnDfy0YxSm+K8QBlcpH0RHh2EuZslXjNOBtLlo4rK/cXWMD33Y34G90HlSUeoYhJyubYWvF6Ey0ManEJldO3ZK5xm8OA0yhuGltiUBc96DsuWws= Received: from DB9PR05CA0005.eurprd05.prod.outlook.com (2603:10a6:10:1da::10) by DU0PR08MB9371.eurprd08.prod.outlook.com (2603:10a6:10:421::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Tue, 6 Aug 2024 14:08:29 +0000 Received: from DU6PEPF0000B61C.eurprd02.prod.outlook.com (2603:10a6:10:1da:cafe::49) by DB9PR05CA0005.outlook.office365.com (2603:10a6:10:1da::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26 via Frontend Transport; Tue, 6 Aug 2024 14:08:29 +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=arm.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 DU6PEPF0000B61C.mail.protection.outlook.com (10.167.8.135) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7849.8 via Frontend Transport; Tue, 6 Aug 2024 14:08:29 +0000 Received: ("Tessian outbound 6c4cfdcc8c7d:v365"); Tue, 06 Aug 2024 14:08:29 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 1fc0fef2707b8209 X-CR-MTA-TID: 64aa7808 Received: from L7676d99e1f03.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6C92F97D-4678-4E27-824D-4B826E49AB07.1; Tue, 06 Aug 2024 14:08:17 +0000 Received: from EUR02-AM0-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id L7676d99e1f03.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 06 Aug 2024 14:08:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sbE5Ys76eqvl82zY3owHX7Yk7n8rgCeYh8ou7AmbBVUjxzl7CjiDyyHcwfj8X2CUf2UTktyUzEaLJ1KjuIeVY2OtgmV85vIZhn5wjDW4aR4O+dcoS4lj25Ftw2sonnIKX/MpVK3ZVPdwdceRrL4v8F5Wm8trDuaSvTjpxSlQzil8oUm9kicARYpKtqbZyB7DVnVu5Xvu0+zr8pUiwV+eYW49cAlm0+Mg4tKiUygTNOKNYmPsQktvgUHYz9kFrOtIsi2beFfLlq6QhbPY3k964jtV7Y0WGZsefkLSq1kYg6GCwrJXfgWUwk1jUIPyEA2CFUBwCyhxTgS5k4uFKugcYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=I+0JAaCkbnQViYnmGyIXNEsjTNvy7ATDOgSVV7q3SSU=; b=K3stgmu12rMSejn5oXfbIMCMTqG54TWRU28rcCraOIkrxGFQQ0woTRLf4J9y6dYafob9/PCOXdCxTlsyM78q2wna8qKCNcJvvxo3xhrCpTv7TLMbUGZGSx+AEvTC2mctNCM33Atd6JXrRaToS+1PGsb53yWq4mdYN0bgmbVMDrTNBQxnl6+RmYdFXjKSWyNGO2Fybt4heitaNve/ZSfSVhxbVGnGw4Bl1X+bFR5HCDg7BZ6Wmgio8fM2sxwbMeqzqtEWTGePpR+HWwD1AO7i1hqKgE2mSnuNj8mSu+3yFOgiOR3bL5PVOpAeka9gqLDNrdbw4fPJ0WyzWpCNf/yWYQ== 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=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I+0JAaCkbnQViYnmGyIXNEsjTNvy7ATDOgSVV7q3SSU=; b=W0isGiMvpTl4JAVZxKA1+UvFs6lFJdZN+recP1gv1t5mEnl2XwEWBSjCnt9KXnDfy0YxSm+K8QBlcpH0RHh2EuZslXjNOBtLlo4rK/cXWMD33Y34G90HlSUeoYhJyubYWvF6Ey0ManEJldO3ZK5xm8OA0yhuGltiUBc96DsuWws= Received: from AS4P189CA0035.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5dd::14) by VI1PR08MB10244.eurprd08.prod.outlook.com (2603:10a6:800:1bd::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.25; Tue, 6 Aug 2024 14:08:14 +0000 Received: from AM3PEPF0000A78D.eurprd04.prod.outlook.com (2603:10a6:20b:5dd:cafe::4d) by AS4P189CA0035.outlook.office365.com (2603:10a6:20b:5dd::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26 via Frontend Transport; Tue, 6 Aug 2024 14:08:14 +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 AM3PEPF0000A78D.mail.protection.outlook.com (10.167.16.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7849.8 via Frontend Transport; Tue, 6 Aug 2024 14:08:14 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 6 Aug 2024 14:08:13 +0000 Received: from PW070M4K.cambridge.arm.com (10.57.67.155) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Tue, 6 Aug 2024 14:08:12 +0000 From: Matthieu Longo To: CC: Richard Earnshaw , Richard Sandiford , "David S . Miller" , "Eric Botcazou" , Jason Merrill , "Cary Coutant" , Matthieu Longo Subject: [PATCH v1 1/4] Rename REG_CFA_TOGGLE_RA_MANGLE to REG_CFA_NEGATE_RA_STATE Date: Tue, 6 Aug 2024 15:07:41 +0100 Message-ID: <20240806140744.1082602-2-matthieu.longo@arm.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240806140744.1082602-1-matthieu.longo@arm.com> References: <20240806140744.1082602-1-matthieu.longo@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM3PEPF0000A78D:EE_|VI1PR08MB10244:EE_|DU6PEPF0000B61C:EE_|DU0PR08MB9371:EE_ X-MS-Office365-Filtering-Correlation-Id: 0fdf4c2b-3a13-4eec-3c32-08dcb6213fa6 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|36860700013|1800799024|376014|82310400026|41080700001; X-Microsoft-Antispam-Message-Info-Original: Ete/sZnaSkYWwfSBuK90pJcLr0RfVuXmuiTeF9FPLJ6Xyp3DhWFk5Lg3PZwtvnMBX0bBbPAXyORrF5fx6pyv75gdYiC/Pq3UVITn6CWteAXCT3VGWiyzcY8VKPbIttjgs353EnJ//aF4HUrB0DiQLftJZgmnEpkW0RpQa1Gm9JQeNeGL3MFombY4b72XB5ARh9dTduJmwZwvVWrzWbNM13qhBuq/2vD1z9iGnCaXNqAj+FQWygn8d2CyYxwtpHLDgMtTEgfAt2mQ3LAH5LtfeO1h4nuqELGQ2dodRVYeqmMuEkKUGpHcGmE1lLvvHngAjYfXOQTdFHqeZUWHddSGurhzP1mqvnQKrSkDzSJ2eFLXyePIOQiQkoCwP+o9dJ+Vgzwap2CM8NphCxsFq6ea6g+SCwRYyOfkl+1iy75k2zib+ZQMEnBleC/uX944C/p94J7ufZyVakpqmLbRkwBFunWhzi3hI2yQU4C3sRAGujBh8gVFF8qReXwvEYjBzOm+PDqJzV0rGAy3o6xvrWTgznHTjXSD8vi7ajcAQB6udo6qbe9FZFAJ26JFm65kDGF2X7KMyPTgb7MtGYc0ranVhV281qCdsQZxoRbnxmTjO8E9xngUtvwskGV395/9cDBuPrLb1YnJbuhtbjNMWZP0ogqai50U3YksDdJiSUvp9rPL0htj+ZCcy+hMNsJ+LfUdKIJv9ANx1LjyvsCbiX7R5mZxCbXa4Ih+dXKE+GbsvnCdc3oXFljeKND3l8J54gHfJRZZwOoBmaxsLRf6hCNbtZ5cRIiLW7j/hDP99cDl57wcfSJU8z2X58XhFi3EXvev7fac+unC8hqKnsORYU0X+flUiOPxVo8FsC72y2XFrlHGb4WwBUSQk7BRohKfNigFrZtkm4aGDiw32ML0htJJr6n+wDF1CXkXzLdga8sJ1cANN7f3k0GuzJ2xeY76dH4fafpSdvbPxCbTP/IvgvNI0ZGIbPI8q8RaI1YW5FFVt1kN0Dd1vXH5j9ZpFuTfH2oqE2zm+vF02TB4C/v07S0J0GeSPfwCO5b0wa4zfBJk8003V7OBWIY2sLLLSSNvlivFR8y1G8nEDc7npVVvpR6soPH6y6mvqABtD+pI4hG/Hi0UR/aVNeRkizznGdYeXN5fN3CF/wsX0wWmQWF7VNJvoUxZvJrSxbu806j+UcKYU/zzTMMsNCzZQTCyaAFTFh3Cx7pTBGYb/OHheiAvUN9BdimnWs2bAU5BzvcOckJ5bHaxff/ILXpdKobDMee00c3VPbsiRKaRgbdqvCgiO47nAkGi4+CRjiR4Ayrha2fEDllYY9MKzSdfOQtCZHfX8HVepTCTlpX2YN6EgcJZmFsubIEQbOGsdO7XjngY6+YILnQ3MDFSQBq2IjFjG/8wYnfGBxo+vpDtGaRCfEM9HIrSQ7TQvPxaVpSQVrUtFWRzlGpjhxYsm80iJ84ixUYDJD0hR1pOdKf0Xdfe3fWE1sEo8Q== 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:(13230040)(36860700013)(1800799024)(376014)(82310400026)(41080700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB10244 X-MS-Exchange-SkipListedInternetSender: ip=[2603:10a6:20b:5dd::14]; domain=AS4P189CA0035.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU6PEPF0000B61C.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c933245e-cfe4-421e-005b-08dcb62136a3 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|36860700013|35042699022|1800799024; X-Microsoft-Antispam-Message-Info: 9bYHvQ/0NVzqpSVbBzpPNRbQVBuBCnUeZWlrErOakbBdEKaX0xQL6q905LwO6Sr2jPCT/7EXP03EJ+5V5p8B59vhotvpptR5SDYuk/EW5i6FFTDOnet7Cuz5cJvRSyeFsrQzs0JNgMZWIQvtNqmHx7k731WHz9Fx2svM7FW4xxhJWwCGQcP1mXlN1B5gvmphNUIxtgTWGbf834ww9I5b6TuarYPF4EYDFmI4DFyjeid0bQCgm44oFqU7FL182cJJYkTImyMHXWe7Vj/seGpFblOFjHX5pW4a8CgldaPAJhI+IcGpTXkZp0xPfLEClVNxowuHyrHCu6fuO6m8dKVB2aIuX6M8NoPGXmuipVyJ7wFAuZQybLbIKgzZZBhSHjN16KVz6k89ADjAMTM1DSex917d0OxlLCA/122KDAbHMtxZzobmks3tTqqRzE4DoZrSa+bLjcvEqLpkH/JuQwUXEin4XrqpkhT5gE7gTK/WozDUQNqtU7/F2DYqJmQdu9CuDnb8AJPJCqzQvD0+PUhDVP3J5z74GJEZW1WI9YxPvoX8uNyAztMorfFoazIyJpZ/CqogHP17PsG000SDxS1158pObXwegCHMzA74L01WEQBIV8u55aKRu7angUD8k96OY0nqWcju1Ovxl/kCp+sAZjnLUFrgnKGvmB5YRAM6nhnWnF7oRtq3CgzEVcVa97lGPyNSpv8iR9PaAE/9nXy7TNm9E6S4IH+4+44fdLIffgCBGY79eYEIlsVgfMuhjnrF+/bOR699kDxo8RliXrzi4QUc7TJUo4sjx+ynJnfMqsrGMcwxtAcVWT+hTpB66GYYDtKMreIOJrrX5OypCqB3g3S0Wd4fRuJLSrlwnLsyum+4JdZj6M1D5FKq3YiEbcR6B83y4MdEkbIPLhqM5g0CF7IwfJ/JahviIMKXcWHH/qKPKlwym7cCizm8Djvdkh2QK8lhiUEJE5fxNJ2wfG9B4pNy6Ha1frYPskKC//aJCfiX1h9h0a0EDkI1mvdgH4QyQl9Cu6Pal8/K2ARyt3rAP42z14MbyhleuN+IRr+UpRvbRuJalaEnj0UgTj1eep97hlv9iH1Jk80BFadqtkry3OuJjufxCrMuesnNY2odbu+NO3K6JYxJQVEXmtIOQYWtZSikGKdXLz5+qhQlOY0r/gG8z1jzInu074vS9S2sI2khTauKDqL2DGPkbchJvSBJo/yaGxv5T5CFyE+0Tggl2mPItmKLIz1ryHZZRlO08TrwoRuN6DyXbHfZSTP2c3QEo8nfX8KVVIlI3RiET8HSUxbi7T3yJ0ZppHxMTYOUttyGYtQLmCHsHLBGXnF53WDEaMJXLCt/7A8SI9E178MSg7WMNnSwqD/MEtspltlzb/Kdg1K1bqODJRhL9z01Nu1tlLs5Y2p5wEpIIC/RLPYmRnvax4cXABoIVpMuns209nIXTGun5FKWOYJPbFZfK46v 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:(13230040)(376014)(82310400026)(36860700013)(35042699022)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 14:08:29.7490 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0fdf4c2b-3a13-4eec-3c32-08dcb6213fa6 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: DU6PEPF0000B61C.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9371 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, SPF_HELO_PASS, SPF_NONE, TXREP, 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~patchwork=sourceware.org@gcc.gnu.org The current name REG_CFA_TOGGLE_RA_MANGLE is not representative of what it really is, i.e. a register to represent several states, not only a binary one. Same for dwarf2out_frame_debug_cfa_toggle_ra_mangle. gcc/ChangeLog: * combine-stack-adj.cc (no_unhandled_cfa): Rename. * config/aarch64/aarch64.cc (aarch64_expand_prologue): Rename. (aarch64_expand_epilogue): Rename. * dwarf2cfi.cc (dwarf2out_frame_debug_cfa_toggle_ra_mangle): Rename this... (dwarf2out_frame_debug_cfa_negate_ra_state): To this. (dwarf2out_frame_debug): Rename. * reg-notes.def (REG_CFA_NOTE): Rename REG_CFA_TOGGLE_RA_MANGLE. --- gcc/combine-stack-adj.cc | 2 +- gcc/config/aarch64/aarch64.cc | 4 ++-- gcc/dwarf2cfi.cc | 8 ++++---- gcc/reg-notes.def | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gcc/combine-stack-adj.cc b/gcc/combine-stack-adj.cc index 2da9bf2bc1e..367d3b66b74 100644 --- a/gcc/combine-stack-adj.cc +++ b/gcc/combine-stack-adj.cc @@ -212,7 +212,7 @@ no_unhandled_cfa (rtx_insn *insn) case REG_CFA_SET_VDRAP: case REG_CFA_WINDOW_SAVE: case REG_CFA_FLUSH_QUEUE: - case REG_CFA_TOGGLE_RA_MANGLE: + case REG_CFA_NEGATE_RA_STATE: return false; } diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index e0cf382998c..0af5d85c36f 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -9606,7 +9606,7 @@ aarch64_expand_prologue (void) default: gcc_unreachable (); } - add_reg_note (insn, REG_CFA_TOGGLE_RA_MANGLE, const0_rtx); + add_reg_note (insn, REG_CFA_NEGATE_RA_STATE, const0_rtx); RTX_FRAME_RELATED_P (insn) = 1; } @@ -10027,7 +10027,7 @@ aarch64_expand_epilogue (rtx_call_insn *sibcall) default: gcc_unreachable (); } - add_reg_note (insn, REG_CFA_TOGGLE_RA_MANGLE, const0_rtx); + add_reg_note (insn, REG_CFA_NEGATE_RA_STATE, const0_rtx); RTX_FRAME_RELATED_P (insn) = 1; } diff --git a/gcc/dwarf2cfi.cc b/gcc/dwarf2cfi.cc index 1231b5bb5f0..4ad9acbd6fd 100644 --- a/gcc/dwarf2cfi.cc +++ b/gcc/dwarf2cfi.cc @@ -1547,13 +1547,13 @@ dwarf2out_frame_debug_cfa_window_save (void) cur_row->window_save = true; } -/* A subroutine of dwarf2out_frame_debug, process a REG_CFA_TOGGLE_RA_MANGLE. +/* A subroutine of dwarf2out_frame_debug, process a REG_CFA_NEGATE_RA_STATE. Note: DW_CFA_GNU_window_save dwarf opcode is reused for toggling RA mangle state, this is a target specific operation on AArch64 and can only be used on other targets if they don't use the window save operation otherwise. */ static void -dwarf2out_frame_debug_cfa_toggle_ra_mangle (void) +dwarf2out_frame_debug_cfa_negate_ra_state (void) { dw_cfi_ref cfi = new_cfi (); @@ -2341,8 +2341,8 @@ dwarf2out_frame_debug (rtx_insn *insn) handled_one = true; break; - case REG_CFA_TOGGLE_RA_MANGLE: - dwarf2out_frame_debug_cfa_toggle_ra_mangle (); + case REG_CFA_NEGATE_RA_STATE: + dwarf2out_frame_debug_cfa_negate_ra_state (); handled_one = true; break; diff --git a/gcc/reg-notes.def b/gcc/reg-notes.def index 5b878fb2a1c..ddcf16b68be 100644 --- a/gcc/reg-notes.def +++ b/gcc/reg-notes.def @@ -180,10 +180,10 @@ REG_CFA_NOTE (CFA_WINDOW_SAVE) the rest of the compiler as a CALL_INSN. */ REG_CFA_NOTE (CFA_FLUSH_QUEUE) -/* Attached to insns that are RTX_FRAME_RELATED_P, toggling the mangling status - of return address. Currently it's only used by AArch64. The argument is - ignored. */ -REG_CFA_NOTE (CFA_TOGGLE_RA_MANGLE) +/* Attached to insns that are RTX_FRAME_RELATED_P, indicating an authentication + of the return address. Currently it's only used by AArch64. + The argument is ignored. */ +REG_CFA_NOTE (CFA_NEGATE_RA_STATE) /* Indicates what exception region an INSN belongs in. This is used to indicate what region to which a call may throw. REGION 0 From patchwork Tue Aug 6 14:07:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Longo X-Patchwork-Id: 95382 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2B01B385841C for ; Tue, 6 Aug 2024 14:10:31 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on20600.outbound.protection.outlook.com [IPv6:2a01:111:f403:260e::600]) by sourceware.org (Postfix) with ESMTPS id 3AD5C385B50D for ; Tue, 6 Aug 2024 14:08:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3AD5C385B50D 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 3AD5C385B50D Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:260e::600 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1722953331; cv=pass; b=nb+qa/8xNBUzVpHHMnhrWiuBmpO1AhIGlRjSidhin8KjXqmdTOlzmfrlBMESMxzBhxNnk3Y8cOKWRJ7G8giV5U6EB5+vreSAmkXpU9+nrtVEko4abuNTsec/6DizNYpZbdzClO/4dqCeaDsolH1P+7sQQjypIzJ89efp8tS/2Ng= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1722953331; c=relaxed/simple; bh=ntnh878IbHXd9hySKTEZr61j0c/j4/rxAHZz3dEMuq0=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=iiiei6lUB7B6s5/LuNbDovjwfOxka0IJOGX+WeoUfLSlcPwic85gnGUFaKnAEW8kU9dv9qn5xk9uMnY4EgiBhxdDfyvxBZal06MSSoUfQ1SJPm1pIjkZnAvhGvj04h0jG8ptJaOqOz61huCjFWSOnJUM3X0mVVO/HnhPiejFPDg= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=pLTqLDZWFZmmnmq3UTU6vIqhOxk+htZ9GU2edPoRkIh03sNazILCJ6UJ5LZeIgl29bOoIBUGC1gvE0cf1b34+PoBJblJ2rIZ4doPg+r4mDFN+UiEFbA4m0ZHs2rht25pvKY6C8vGdidDYuQhPL/oYMWoQB470HjmbgAEj8L6Y2FsRKJkHc/tnFkpPAFgfA9RnIQxiu/RTrjZ1x/UpLVhqyteQPtRNO2c/Zov74eW8WlSTcbMdTqaRlTBlIvjR4bCdys5oqF3+BdARCZ5rQ2JIodXzPm3NKps9v3708HUFgWPeh3IQND7aYkpZh08YWm+cyzcU4E+nqM8tiM5huZbMQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=utnv0K7idnL9uAjXpOEQ6AuQgEp66kLNagi6bcPz93Q=; b=M44HCvOYbWdfR9G2bd9QnHpcVlvv7ekMHSff/+s9NxDzN1Ga2iTRYsc8Ov7CpBPRCUMwhCx2we9A97H/7QjqfvpWhUMJ/Ps9ACLzF5zWZZSo3uyR8X7VJMCQ/xByUkGoD0SJjvCUakefBMUhkxH+c0zuUh1i8cBjkrM2ayg4hp45zlPi73KtnkJcFnKvYUoQR862cU1hjN0nuaUaR15DAhXsACIDCMqsJHfJDWFj1iLRnL/MA/Roidx8qOI7sPGWZEDPfdBVA0LInWrjWDVjINuOB/MZwXxbbXa5jMbWK9Xvz4zSM2TfwKK2jumE+0IkJpHLF37UWRqtbXgDRAywYg== 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=arm.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=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=utnv0K7idnL9uAjXpOEQ6AuQgEp66kLNagi6bcPz93Q=; b=UI8wO3ZgfibtWMgY1JuAqNcNTArS2zL6Kbs+150ljhXIzsAWRwJknQcw7X9KDFhq+G05pkLx5j36YM1jL3ejrt7snZVTkUZY7FpuH9461MV1fsvOf+ScbWWkn0seuQj5RUqwsPTa8ANDJy+LDnIsHW+ZdHXhGWIqW6D9LeUk8n8= Received: from AM0PR04CA0131.eurprd04.prod.outlook.com (2603:10a6:208:55::36) by PAVPR08MB9578.eurprd08.prod.outlook.com (2603:10a6:102:310::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Tue, 6 Aug 2024 14:08:44 +0000 Received: from AMS0EPF0000019E.eurprd05.prod.outlook.com (2603:10a6:208:55:cafe::70) by AM0PR04CA0131.outlook.office365.com (2603:10a6:208:55::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.11 via Frontend Transport; Tue, 6 Aug 2024 14:08:44 +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=arm.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 AMS0EPF0000019E.mail.protection.outlook.com (10.167.16.250) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7849.8 via Frontend Transport; Tue, 6 Aug 2024 14:08:44 +0000 Received: ("Tessian outbound ea7ddef4508e:v365"); Tue, 06 Aug 2024 14:08:43 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: acd3d890c19f65ae X-CR-MTA-TID: 64aa7808 Received: from L3c27df1ebe4b.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E362ADD3-26BF-4DDA-8DB9-6588AD266CE3.1; Tue, 06 Aug 2024 14:08:33 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id L3c27df1ebe4b.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 06 Aug 2024 14:08:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mvJfPXcJoSgvQNCAasVDMixAaymqHhY2926FXTsGvvuNe4GorJB2enlbYoRcuNdi7Od1GQAVkMppKK7dN/Y3hiB04iuenMfoyPAcBWztXnchptirUmH8g60YnMHU4tN/gZNiRxq+Iaa1zRYCY1kB58EOCwbyvA6Cv8EL7Jdb29fE8EbZ9I/nZxS62h9lcQpBenJ8IOpWf//iwBrdnleEhhYMOokpP3rSenOg8G2+mkV78ZHlnjbJjcm9e+kXFc7GKUVXcQb2XTD7ipRW6BsDFQdmCaql7QNdPk+wwmbTOdy+giPSG60u4vnQwzWE4rONxLEpXNIxv+Bo3M4BtkYE3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=utnv0K7idnL9uAjXpOEQ6AuQgEp66kLNagi6bcPz93Q=; b=n6mY3o7NRhfvEPRj9zYdyM5MEORigtNFq4Gs/MRet69/fGhfbzbVaHTC2VAktCeQCJ181M4or2CZ3+F9R1bolVMIy1IhFIKF0/v0plwbdCzgiWf+agC7qLxYjlA4dwxdXDHHhsj7Ky/TbfEKIS9hDRXlYAhFAWpZ5D9bDiT47FnbGrtGVzZaki4ooKl+L2afPqftkOGVAC+1htM8itzPx8L8xd8RleHHx4v1+1vobD4T2/e9OnTsMEgNvXXG37s8RRheAxrYZyHi/ofF2YSJ8UwgQBFRXvtWBYdr7wVJoe9oisG5Flu5De09CiGKulOmYzNunLjuzMTCCpbcQD+n0w== 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=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=utnv0K7idnL9uAjXpOEQ6AuQgEp66kLNagi6bcPz93Q=; b=UI8wO3ZgfibtWMgY1JuAqNcNTArS2zL6Kbs+150ljhXIzsAWRwJknQcw7X9KDFhq+G05pkLx5j36YM1jL3ejrt7snZVTkUZY7FpuH9461MV1fsvOf+ScbWWkn0seuQj5RUqwsPTa8ANDJy+LDnIsHW+ZdHXhGWIqW6D9LeUk8n8= Received: from DU2PR04CA0191.eurprd04.prod.outlook.com (2603:10a6:10:28d::16) by GV2PR08MB10384.eurprd08.prod.outlook.com (2603:10a6:150:b2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.25; Tue, 6 Aug 2024 14:08:26 +0000 Received: from DB5PEPF00014B8E.eurprd02.prod.outlook.com (2603:10a6:10:28d:cafe::b7) by DU2PR04CA0191.outlook.office365.com (2603:10a6:10:28d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26 via Frontend Transport; Tue, 6 Aug 2024 14:08:26 +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 DB5PEPF00014B8E.mail.protection.outlook.com (10.167.8.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7849.8 via Frontend Transport; Tue, 6 Aug 2024 14:08:25 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.39; Tue, 6 Aug 2024 14:08:24 +0000 Received: from PW070M4K.cambridge.arm.com (10.57.67.155) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Tue, 6 Aug 2024 14:08:23 +0000 From: Matthieu Longo To: CC: Richard Earnshaw , Richard Sandiford , "David S . Miller" , "Eric Botcazou" , Jason Merrill , "Cary Coutant" , Matthieu Longo Subject: [PATCH v1 2/4] dwarf2: add hooks for architecture-specific CFIs Date: Tue, 6 Aug 2024 15:07:42 +0100 Message-ID: <20240806140744.1082602-3-matthieu.longo@arm.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240806140744.1082602-1-matthieu.longo@arm.com> References: <20240806140744.1082602-1-matthieu.longo@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DB5PEPF00014B8E:EE_|GV2PR08MB10384:EE_|AMS0EPF0000019E:EE_|PAVPR08MB9578:EE_ X-MS-Office365-Filtering-Correlation-Id: e3f4aa83-d25b-4ea2-b0bd-08dcb6214840 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|82310400026|36860700013|376014|1800799024|41080700001; X-Microsoft-Antispam-Message-Info-Original: CNS8yT0UD+pDF+XmSsWNXyLhSL+NCjrkgd9qxe2NecM0mLGyrc67MM78OD6RVuBbP3VMYantSIzbPncTf5AiFHVBN+QLL8y0lvccTuXdD2oyI3a2JvD1Lx0NPVXKlGR6SAPwwa6mp1SdLr5JjuYKHMtOUXPQk/Hk+jSoaxrzYxuQArNhtYzf16IuwYstTn2+uB2RLY91RaEBYo0ataR+rFQ1HhEt+JMHw3L53jTMypQUuani2KHmtlccnshlRmlqlRhOItqDoQVXjeNNXiXHT8I+9r/YTJBa40agt49p2161blQowl7euYqLaByXlTcE4l9OLV4fcCYtoc5pbLzlQiaKovAecMU4TjR024E2lBGwMzxeVhF2Cfsd8qDyR/HGCMf5RRadVvjMkMzfjZW/uTfNB38WVhNf4LPl7YTJystCyR27RU+/zK1GgbApKhfxQfFZFu/qScccY9XU8wqYcJA5Fto1xYnyp+F2cH/1SgFiMyu9v+zhgaYt6YTgEFLvGCac0Avj/76SbSh/oEJ3W5NGFdM02Qoy+8r9iZAqrZfKsITApZHotdWkrz1jPUfXCVEHlQVlGbn/nhCDhGL83WdwgE8T8hGSLfMvF8z1iUXDJzwS2MKFO9dDRwTTamJpEj5A4xkqgyEI+U/pML2FpA+PPQRs+LQ0xuIQGxXsGmg+XcJdghJO7wTpXrhcna6DUQZG1aw0J734zzH+cCJNihNs62aTvM/4ok0Y7hTKRO+/WWQA18nOJivZdqufNnQpvDa495j4lPqQEQhsT7zRknFDs8NR63AzV6tuEnL9a7GFPxVTwmds30u5BeG5BBuuJliigls+UK7WR0aPl6Q0DuGRpOX3hi+SxsJ7HWIAKbF4ya3DrunUGU/mtg+VyWNGs7bR6dVE1kZmZlmWcmxwx+HGpXO+9JlU+XzW1GTFm314Y8uPPiY/rGYCt8XpX9LZKv7HpInJJHPNyFdkc/9zUc+Mc3E693w0e/UhDqrk72k48EaEg/t884Zt+9Gy2n92k4kyi1+TYN7VQAUrULGLC6LSiALjRzgWaTItKeYR2XhpXuR9Xyr2AyhmyRnujGCfTQwi1myMFhJAv4TBgcOGvqb3Z3rVuOQp9TweBw2LGLm2Xs4KWIns0HVwaEx7AvaTeL45iBI2945C2IAJroah6lpL7opufll/tAqIH/GAfygAphn/cIzhYOh6evOqeDXBL2Vq2t0LF0MlAJOd7zOaEHGnD1E+juXuSxMHVCvxGjTpDiNXxMLoxXgw/YNqfyuB+0SSeLyD2/A5QYf7TODdf3lLgEcZqyxeDWTavndRzdNtZK9EpU4yzM/Sw+llHxZ6xxFOjoREg8bWTpytoMQ1P+EVZXajgL+BTYzvxpkF6D2FlCT9NDApaSQI+z7N5rLqHsa1COLBAz+8vHHCci56jRSx1OkKKsZyn56UccP6ds8= 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:(13230040)(82310400026)(36860700013)(376014)(1800799024)(41080700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB10384 X-MS-Exchange-SkipListedInternetSender: ip=[2603:10a6:10:28d::16]; domain=DU2PR04CA0191.eurprd04.prod.outlook.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AMS0EPF0000019E.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a04fe1d3-718b-4027-cc97-08dcb6213cd6 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|82310400026|376014|35042699022|36860700013; X-Microsoft-Antispam-Message-Info: XiyLITlI15uE/+rYUrio4mqsrCUbCzPh+YigI9b4XJhdftT0P4YixK4n+eWl/uB7CVMI9E04nTc6sRhWBuC7HugO7uRP9m6b7hUK//phOgu6a/bkPDT/mT7gFX1UawvO8MI4DgEuTiORQamHcPSCX/gVunON1RjX/GaI+B0+708MkLZ0lYFpDNor21b58DoHFlk/X7+ZRAScS3Xd2aty2bHNXVhsSPmOb12YgD8Nk/buU1mpUMf9dzuJ24gwUQsp7AXgrXifJwr4QQ1W68l7MuiD5zSgcBsGMvwkURyOZ75PnLMiVEgWBV+qY+1041t/3eghyOPmnw5NUnQB2YCyg5B22964e+wXrIWIID2IejN8Yy06ARSvayqgde9FTYcfcHzJ56c3CgcwIa5GiW7kJWwEBB92YE/feaIKmT3xsBTjNY0j1gCnUfUn0fJ6s1m9Uh7oFixMfcAX1dBqS/WM2Vg0UxargVSG15CQCzGJdvtCeLjh8SKlqWFf2pdlfZyyz4fmNShsKTYV3cu5VBiR1MIBRthhOJs8F7O/RHYp6D1IYHwDiWnxSZPJnSjI/evDu3zrJ/N0y9vPO4Pe/Q6Y3SoQ8sR4PfssdrLxFmssh8UQG1UmmrfC+Hkqlqk7uWnvKv6gf+On1O3ea67kVCTU6SJYmht1hOw6HoIGb/EfjV5fZ2v5KzJ6v9jsMEHWWH0tOkNzliCfbFvFsTj8CiTzrjknHLYJYdKkh4eI8IFq+oB5LvViRUUYbOBZ7x0IFs+PgqMsFEfW6bMZLZ4LZpEe77jfZLl0VH+CIjJWpwwRKBmoPIERelSn36K/SI/Zzvwhw3mppFryJjBLbeuPu25XpwYc2eU6d63Ery3xLX4H8smiFUgcg/GNEm/W3uUGZDAb5iMBldjL8tIMgQagJtNegUeFEemEzQYaU9PW16DP/ck7d66Y0sze7zwJkpVOu8OWTS57XMN7MIKFXv19Gz1yOw/wR6GE30j5kBsCG9SzTEyj4F9uQRZr9Knhlxi71tPC9RrBux2ckTuq/aHD6NEAT7S1Y19Aw3vM6yxSbOTJc9nXXLsu1bOxH+OSzRD+1ro6zrulhpoDYYf757yAQjwebdI4b0OXnWIrGKYRKHupjNp0jOqjAhbKnUWrYdYKbGGodH4sP8VYdqDpKRLAD6FIhXKIL9CjbqzjNqub9ycgxlBTUehFoNFJqIiNsFD7IBtqAScuKHnJiIch9/1nGEb3SkcjBasBuC5NAK60SqRIKAf3KptHd+A/AoN3k5vDAv5JrhN70BdvO1ZT1K2i7bmxNfskhlXFI8bssvjoO0mcWx4NTrANH3Hd/rGOPcHBUNIcR6ET8SJGjV2OXJybpfwjyi2qihyUyuG8puumYBh8XcRLgkOwtu5uS+PYNuCy1Awg 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:(13230040)(1800799024)(82310400026)(376014)(35042699022)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 14:08:44.1361 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3f4aa83-d25b-4ea2-b0bd-08dcb6214840 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: AMS0EPF0000019E.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9578 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, SPF_HELO_PASS, SPF_NONE, TXREP, 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~patchwork=sourceware.org@gcc.gnu.org Architecture-specific CFI directives are currently declared an processed among others architecture-independent CFI directives in gcc/dwarf2* files. This approach creates confusion, specifically in the case of DWARF instructions in the vendor space and using the same instruction code. Such a clash currently happen between DW_CFA_GNU_window_save (used on SPARC) and DW_CFA_AARCH64_negate_ra_state (used on AArch64), and both having the same instruction code 0x2d. Then AArch64 compilers generates a SPARC CFI directive (.cfi_window_save) instead of .cfi_negate_ra_state, contrarilly to what is expected in [DWARF for the Arm 64-bit Architecture (AArch64)](https://github.com/ ARM-software/abi-aa/blob/main/aadwarf64/aadwarf64.rst). This refactoring does not solve completely the problem, but improve the situation by moving some of the processing of those directives (more specifically their output in the assembly) to the backend via 2 target hooks: - DW_CFI_OPRND1_DESC: parse the first operand of the directive (if any). - OUTPUT_CFI_DIRECTIVE: output the CFI directive as a string. Additionally, this patch also contains a renaming of an enum used for return address mangling on AArch64. gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_output_cfi_directive): New hook for CFI directives. (aarch64_dw_cfi_oprnd1_desc): Same. (TARGET_OUTPUT_CFI_DIRECTIVE): Hook for output_cfi_directive. (TARGET_DW_CFI_OPRND1_DESC): Hook for dw_cfi_oprnd1_desc. * config/sparc/sparc.cc (sparc_output_cfi_directive): New hook for CFI directives. (sparc_dw_cfi_oprnd1_desc): Same. (TARGET_OUTPUT_CFI_DIRECTIVE): Hook for output_cfi_directive. (TARGET_DW_CFI_OPRND1_DESC): Hook for dw_cfi_oprnd1_desc. * coretypes.h (struct dw_cfi_node): Forward declaration of CFI type from gcc/dwarf2out.h. (enum dw_cfi_oprnd_type): Same. * doc/tm.texi: Regenerated from doc/tm.texi.in. * doc/tm.texi.in: Add doc for OUTPUT_CFI_DIRECTIVE and DW_CFI_OPRND1_DESC. * dwarf2cfi.cc (struct dw_cfi_row): Update the description for window_save and ra_mangled. (cfi_equal_p): Adapt parameter of dw_cfi_oprnd1_desc. (dwarf2out_frame_debug_cfa_negate_ra_state): Use AArch64 CFI directive instead of the SPARC one. (change_cfi_row): Use the right CFI directive's name for RA mangling. (output_cfi): Remove explicit architecture-specific CFI directive DW_CFA_GNU_window_save that falls into default case. (output_cfi_directive): Use target hook as default. * dwarf2out.cc (dw_cfi_oprnd1_desc): Use target hook as default. * dwarf2out.h (enum dw_cfi_oprnd_type): specify underlying type of enum to allow forward declaration. (dw_cfi_oprnd1_desc): Change type of parameter. (output_cfi_directive): Use dw_cfi_ref instead of struct dw_cfi_node *. * target.def: Documentation for new hooks. libffi/ChangeLog: * include/ffi_cfi.h (cfi_negate_ra_state): Declare AArch64 cfi directive. libgcc/ChangeLog: * config/aarch64/aarch64-asm.h (PACIASP): Replace SPARC CFI directive by AArch64 one. (AUTIASP): Same. libitm/ChangeLog: * config/aarch64/sjlj.S: Replace SPARC CFI directive by AArch64 one. gcc/testsuite/ChangeLog: * g++.target/aarch64/pr94515-1.C: Replace SPARC CFI directive by AArch64 one. * g++.target/aarch64/pr94515-2.C: Same. --- gcc/config/aarch64/aarch64.cc | 32 +++++++++++++++++ gcc/config/sparc/sparc.cc | 36 ++++++++++++++++++++ gcc/coretypes.h | 6 ++++ gcc/doc/tm.texi | 28 +++++++++++++++ gcc/doc/tm.texi.in | 17 +++++++++ gcc/dwarf2cfi.cc | 29 ++++++---------- gcc/dwarf2out.cc | 13 ++++--- gcc/dwarf2out.h | 10 +++--- gcc/target.def | 20 +++++++++++ gcc/testsuite/g++.target/aarch64/pr94515-1.C | 6 ++-- gcc/testsuite/g++.target/aarch64/pr94515-2.C | 2 +- libffi/include/ffi_cfi.h | 2 ++ libgcc/config/aarch64/aarch64-asm.h | 4 +-- libitm/config/aarch64/sjlj.S | 10 +++--- 14 files changed, 176 insertions(+), 39 deletions(-) diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index 0af5d85c36f..1f87779f40a 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -59,6 +59,7 @@ #include "opts.h" #include "gimplify.h" #include "dwarf2.h" +#include "dwarf2out.h" #include "gimple-iterator.h" #include "tree-vectorizer.h" #include "aarch64-cost-tables.h" @@ -1449,6 +1450,31 @@ aarch64_dwarf_frame_reg_mode (int regno) return default_dwarf_frame_reg_mode (regno); } +/* Implement TARGET_OUTPUT_CFI_DIRECTIVE. */ +static bool +aarch64_output_cfi_directive (FILE *f, dw_cfi_ref cfi) +{ + bool found = false; + if (cfi->dw_cfi_opc == DW_CFA_AARCH64_negate_ra_state) + { + fprintf (f, "\t.cfi_negate_ra_state\n"); + found = true; + } + return found; +} + +/* Implement TARGET_DW_CFI_OPRND1_DESC. */ +static bool +aarch64_dw_cfi_oprnd1_desc(dw_cfi_ref cfi, dw_cfi_oprnd_type_ref oprnd_type) +{ + if (cfi->dw_cfi_opc == DW_CFA_AARCH64_negate_ra_state) + { + oprnd_type = dw_cfi_oprnd_unused; + return true; + } + return false; +} + /* If X is a CONST_DOUBLE, return its bit representation as a constant integer, otherwise return X unmodified. */ static rtx @@ -30750,6 +30776,12 @@ aarch64_libgcc_floating_mode_supported_p #undef TARGET_DWARF_FRAME_REG_MODE #define TARGET_DWARF_FRAME_REG_MODE aarch64_dwarf_frame_reg_mode +#undef TARGET_OUTPUT_CFI_DIRECTIVE +#define TARGET_OUTPUT_CFI_DIRECTIVE aarch64_output_cfi_directive + +#undef TARGET_DW_CFI_OPRND1_DESC +#define TARGET_DW_CFI_OPRND1_DESC aarch64_dw_cfi_oprnd1_desc + #undef TARGET_PROMOTED_TYPE #define TARGET_PROMOTED_TYPE aarch64_promoted_type diff --git a/gcc/config/sparc/sparc.cc b/gcc/config/sparc/sparc.cc index 9282fb43b44..4de2f1895b6 100644 --- a/gcc/config/sparc/sparc.cc +++ b/gcc/config/sparc/sparc.cc @@ -61,6 +61,7 @@ along with GCC; see the file COPYING3. If not see #include "builtins.h" #include "tree-vector-builder.h" #include "opts.h" +#include "dwarf2out.h" /* This file should be included last. */ #include "target-def.h" @@ -681,6 +682,8 @@ static rtx sparc_libcall_value (machine_mode, const_rtx); static bool sparc_function_value_regno_p (const unsigned int); static unsigned HOST_WIDE_INT sparc_asan_shadow_offset (void); static void sparc_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED; +static bool sparc_output_cfi_directive (FILE *, dw_cfi_ref); +static bool sparc_dw_cfi_oprnd1_desc (dw_cfi_ref, dw_cfi_oprnd_type_ref); static void sparc_file_end (void); static bool sparc_frame_pointer_required (void); static bool sparc_can_eliminate (const int, const int); @@ -878,6 +881,12 @@ char sparc_hard_reg_printed[8]; #define TARGET_ASM_OUTPUT_DWARF_DTPREL sparc_output_dwarf_dtprel #endif +#undef TARGET_OUTPUT_CFI_DIRECTIVE +#define TARGET_OUTPUT_CFI_DIRECTIVE sparc_output_cfi_directive + +#undef TARGET_DW_CFI_OPRND1_DESC +#define TARGET_DW_CFI_OPRND1_DESC sparc_dw_cfi_oprnd1_desc + #undef TARGET_ASM_FILE_END #define TARGET_ASM_FILE_END sparc_file_end @@ -12621,6 +12630,33 @@ sparc_output_dwarf_dtprel (FILE *file, int size, rtx x) fputs (")", file); } +/* This is called from gcc/dwarf2cfi.cc via TARGET_OUTPUT_CFI_DIRECTIVE. + It outputs SPARC-specific CFI directives (if any). */ +static bool +sparc_output_cfi_directive (FILE *f, dw_cfi_ref cfi) +{ + if (cfi->dw_cfi_opc == DW_CFA_GNU_window_save) + { + fprintf (f, "\t.cfi_window_save\n"); + return true; + } + return false; +} + +/* This is called from gcc/dwarf2out.cc via TARGET_DW_CFI_OPRND1_DESC. + It describes for the GTY machinery what parts of the first operand + is used. */ +static bool +sparc_dw_cfi_oprnd1_desc (dw_cfi_ref cfi, dw_cfi_oprnd_type_ref oprnd_type) +{ + if (cfi->dw_cfi_opc == DW_CFA_GNU_window_save) + { + oprnd_type = dw_cfi_oprnd_unused; + return true; + } + return false; +} + /* Do whatever processing is required at the end of a file. */ static void diff --git a/gcc/coretypes.h b/gcc/coretypes.h index 0544bb8fd97..3b622961b7a 100644 --- a/gcc/coretypes.h +++ b/gcc/coretypes.h @@ -141,6 +141,12 @@ struct gomp_single; struct gomp_target; struct gomp_teams; +/* Forward declaration of CFI's and DWARF's types. */ +struct dw_cfi_node; +using dw_cfi_ref = struct dw_cfi_node *; +enum dw_cfi_oprnd_type: unsigned int; +using dw_cfi_oprnd_type_ref = enum dw_cfi_oprnd_type &; + /* Subclasses of symtab_node, using indentation to show the class hierarchy. */ diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index c7535d07f4d..1645e1cb0ce 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -3911,7 +3911,20 @@ used in .eh_frame or .debug_frame is different from that used in other debug info sections. Given a GCC hard register number, this macro should return the .eh_frame register number. The default is @code{DEBUGGER_REGNO (@var{regno})}. +@end defmac + + +@defmac OUTPUT_CFI_DIRECTIVE (@var{f}, @var{cfi}) + +Define this macro if the target has additional CFI directives. Return +true if an architecture-specific directive was found, false otherwise. +@end defmac +@defmac DW_CFI_OPRND1_DESC (@var{cfi}, @var{oprnd_type}) + +Define this macro if the target has additional CFI directives. Return +true if an architecture-specific directive was found and @var{oprnd_type} +is set, false otherwise and @var{oprnd_type} is not modified. @end defmac @defmac DWARF2_FRAME_REG_OUT (@var{regno}, @var{for_eh}) @@ -10039,6 +10052,21 @@ used to return a smaller mode than the raw mode to prevent call clobbered parts of a register altering the frame register size @end deftypefn +@deftypefn {Target Hook} bool TARGET_OUTPUT_CFI_DIRECTIVE (FILE * @var{f}, dw_cfi_ref @var{cfi}) +This hook handles architecture-specific CFI directives and prints +them out to the assembly file @var{f}. +Return true if a architecture-specific directive was found, false +otherwise. +@end deftypefn + +@deftypefn {Target Hook} bool TARGET_DW_CFI_OPRND1_DESC (dw_cfi_ref @var{cfi}, dw_cfi_oprnd_type_ref @var{oprnd_type}) +This hook informs the caller what the architecture-specific directives +takes as a first operand. +Return true if a architecture-specific directive was found and +@var{oprnd_type} is set, false otherwise and @var{oprnd_type} is not +modified. +@end deftypefn + @deftypefn {Target Hook} void TARGET_INIT_DWARF_REG_SIZES_EXTRA (tree @var{address}) If some registers are represented in Dwarf-2 unwind information in multiple pieces, define this hook to fill in information about the diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 64cea3b1eda..051217d68b1 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -3108,7 +3108,20 @@ used in .eh_frame or .debug_frame is different from that used in other debug info sections. Given a GCC hard register number, this macro should return the .eh_frame register number. The default is @code{DEBUGGER_REGNO (@var{regno})}. +@end defmac + + +@defmac OUTPUT_CFI_DIRECTIVE (@var{f}, @var{cfi}) + +Define this macro if the target has additional CFI directives. Return +true if an architecture-specific directive was found, false otherwise. +@end defmac + +@defmac DW_CFI_OPRND1_DESC (@var{cfi}, @var{oprnd_type}) +Define this macro if the target has additional CFI directives. Return +true if an architecture-specific directive was found and @var{oprnd_type} +is set, false otherwise and @var{oprnd_type} is not modified. @end defmac @defmac DWARF2_FRAME_REG_OUT (@var{regno}, @var{for_eh}) @@ -6612,6 +6625,10 @@ the target supports DWARF 2 frame unwind information. @hook TARGET_DWARF_FRAME_REG_MODE +@hook TARGET_OUTPUT_CFI_DIRECTIVE + +@hook TARGET_DW_CFI_OPRND1_DESC + @hook TARGET_INIT_DWARF_REG_SIZES_EXTRA @hook TARGET_ASM_TTYPE diff --git a/gcc/dwarf2cfi.cc b/gcc/dwarf2cfi.cc index 4ad9acbd6fd..6c80e0b17bd 100644 --- a/gcc/dwarf2cfi.cc +++ b/gcc/dwarf2cfi.cc @@ -69,10 +69,12 @@ struct GTY(()) dw_cfi_row /* The expressions for any register column that is saved. */ cfi_vec reg_save; - /* True if the register window is saved. */ + /* Sparc extension for DW_CFA_GNU_window_save. + True if the register window is saved. */ bool window_save; - /* True if the return address is in a mangled state. */ + /* Aarch64 extension for DW_CFA_AARCH64_negate_ra_state. + True if the return address is in a mangled state. */ bool ra_mangled; }; @@ -816,7 +818,7 @@ cfi_equal_p (dw_cfi_ref a, dw_cfi_ref b) /* Compare the two operands, re-using the type of the operands as already exposed elsewhere. */ - return (cfi_oprnd_equal_p (dw_cfi_oprnd1_desc (opc), + return (cfi_oprnd_equal_p (dw_cfi_oprnd1_desc (a), &a->dw_cfi_oprnd1, &b->dw_cfi_oprnd1) && cfi_oprnd_equal_p (dw_cfi_oprnd2_desc (opc), &a->dw_cfi_oprnd2, &b->dw_cfi_oprnd2)); @@ -1547,17 +1549,13 @@ dwarf2out_frame_debug_cfa_window_save (void) cur_row->window_save = true; } -/* A subroutine of dwarf2out_frame_debug, process a REG_CFA_NEGATE_RA_STATE. - Note: DW_CFA_GNU_window_save dwarf opcode is reused for toggling RA mangle - state, this is a target specific operation on AArch64 and can only be used - on other targets if they don't use the window save operation otherwise. */ +/*A subroutine of dwarf2out_frame_debug, process REG_CFA_NEGATE_RA_STATE. */ static void dwarf2out_frame_debug_cfa_negate_ra_state (void) { dw_cfi_ref cfi = new_cfi (); - - cfi->dw_cfi_opc = DW_CFA_GNU_window_save; + cfi->dw_cfi_opc = DW_CFA_AARCH64_negate_ra_state; add_cfi (cfi); cur_row->ra_mangled = !cur_row->ra_mangled; } @@ -2426,8 +2424,7 @@ change_cfi_row (dw_cfi_row *old_row, dw_cfi_row *new_row) dw_cfi_ref cfi = new_cfi (); gcc_assert (!old_row->window_save && !new_row->window_save); - /* DW_CFA_GNU_window_save is reused for toggling RA mangle state. */ - cfi->dw_cfi_opc = DW_CFA_GNU_window_save; + cfi->dw_cfi_opc = DW_CFA_AARCH64_negate_ra_state; add_cfi (cfi); } } @@ -3516,9 +3513,6 @@ output_cfi (dw_cfi_ref cfi, dw_fde_ref fde, int for_eh) dw2_asm_output_data_sleb128 (off, NULL); break; - case DW_CFA_GNU_window_save: - break; - case DW_CFA_def_cfa_expression: case DW_CFA_expression: case DW_CFA_val_expression: @@ -3631,10 +3625,6 @@ output_cfi_directive (FILE *f, dw_cfi_ref cfi) } break; - case DW_CFA_GNU_window_save: - fprintf (f, "\t.cfi_window_save\n"); - break; - case DW_CFA_def_cfa_expression: case DW_CFA_expression: case DW_CFA_val_expression: @@ -3651,7 +3641,8 @@ output_cfi_directive (FILE *f, dw_cfi_ref cfi) break; default: - gcc_unreachable (); + if (!targetm.output_cfi_directive (f, cfi)) + gcc_unreachable (); } } diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index 357efaa5990..260593421df 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -516,12 +516,11 @@ switch_to_frame_table_section (int for_eh, bool back) /* Describe for the GTY machinery what parts of dw_cfi_oprnd1 are used. */ enum dw_cfi_oprnd_type -dw_cfi_oprnd1_desc (enum dwarf_call_frame_info cfi) +dw_cfi_oprnd1_desc (dw_cfi_ref cfi) { - switch (cfi) + switch (cfi->dw_cfi_opc) { case DW_CFA_nop: - case DW_CFA_GNU_window_save: case DW_CFA_remember_state: case DW_CFA_restore_state: return dw_cfi_oprnd_unused; @@ -557,7 +556,13 @@ dw_cfi_oprnd1_desc (enum dwarf_call_frame_info cfi) return dw_cfi_oprnd_loc; default: - gcc_unreachable (); + { + dw_cfi_oprnd_type oprnd_type; + if (targetm.dw_cfi_oprnd1_desc (cfi, oprnd_type)) + return oprnd_type; + else + gcc_unreachable (); + } } } diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h index a424981b911..da0b0bf0203 100644 --- a/gcc/dwarf2out.h +++ b/gcc/dwarf2out.h @@ -38,7 +38,7 @@ typedef struct dw_wide_int *dw_wide_int_ptr; and address fields are provided as possible operands; their use is selected by the opcode field. */ -enum dw_cfi_oprnd_type { +enum dw_cfi_oprnd_type: unsigned int { dw_cfi_oprnd_unused, dw_cfi_oprnd_reg_num, dw_cfi_oprnd_offset, @@ -46,6 +46,7 @@ enum dw_cfi_oprnd_type { dw_cfi_oprnd_loc, dw_cfi_oprnd_cfa_loc }; +using dw_cfi_oprnd_type_ref = enum dw_cfi_oprnd_type &; typedef union GTY(()) { unsigned int GTY ((tag ("dw_cfi_oprnd_reg_num"))) dw_cfi_reg_num; @@ -58,7 +59,7 @@ typedef union GTY(()) { struct GTY(()) dw_cfi_node { enum dwarf_call_frame_info dw_cfi_opc; - dw_cfi_oprnd GTY ((desc ("dw_cfi_oprnd1_desc (%1.dw_cfi_opc)"))) + dw_cfi_oprnd GTY ((desc ("dw_cfi_oprnd1_desc (&%1)"))) dw_cfi_oprnd1; dw_cfi_oprnd GTY ((desc ("dw_cfi_oprnd2_desc (%1.dw_cfi_opc)"))) dw_cfi_oprnd2; @@ -368,12 +369,11 @@ extern void output_cfi (dw_cfi_ref, dw_fde_ref, int); extern GTY(()) cfi_vec cie_cfi_vec; /* Interface from dwarf2*.c to the rest of the compiler. */ -extern enum dw_cfi_oprnd_type dw_cfi_oprnd1_desc - (enum dwarf_call_frame_info cfi); +extern enum dw_cfi_oprnd_type dw_cfi_oprnd1_desc (dw_cfi_ref cfi); extern enum dw_cfi_oprnd_type dw_cfi_oprnd2_desc (enum dwarf_call_frame_info cfi); -extern void output_cfi_directive (FILE *f, struct dw_cfi_node *cfi); +extern void output_cfi_directive (FILE *f, dw_cfi_ref cfi); extern void dwarf2out_emit_cfi (dw_cfi_ref cfi); diff --git a/gcc/target.def b/gcc/target.def index 3de1aad4c84..6a6470f202a 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -4114,6 +4114,26 @@ clobbered parts of a register altering the frame register size", machine_mode, (int regno), default_dwarf_frame_reg_mode) +/* Print out architecture-specific CFI directives to the assembly file. */ +DEFHOOK +(output_cfi_directive, + "This hook handles architecture-specific CFI directives and prints\n\ +them out to the assembly file @var{f}.\n\ +Return true if a architecture-specific directive was found, false\n\ +otherwise.", + bool, (FILE * f, dw_cfi_ref cfi), + hook_bool_void_false) + +DEFHOOK +(dw_cfi_oprnd1_desc, + "This hook informs the caller what the architecture-specific directives\n\ +takes as a first operand.\n\ +Return true if a architecture-specific directive was found and\n\ +@var{oprnd_type} is set, false otherwise and @var{oprnd_type} is not\n\ +modified.", + bool, (dw_cfi_ref cfi, dw_cfi_oprnd_type_ref oprnd_type), + hook_bool_void_false) + /* If expand_builtin_init_dwarf_reg_sizes needs to fill in table entries not corresponding directly to registers below FIRST_PSEUDO_REGISTER, this hook should generate the necessary diff --git a/gcc/testsuite/g++.target/aarch64/pr94515-1.C b/gcc/testsuite/g++.target/aarch64/pr94515-1.C index 20ae81215fc..d5c114a83a8 100644 --- a/gcc/testsuite/g++.target/aarch64/pr94515-1.C +++ b/gcc/testsuite/g++.target/aarch64/pr94515-1.C @@ -1,4 +1,4 @@ -/* PR target/94515. Check .cfi_window_save with multiple return paths. */ +/* PR target/94515. Check .cfi_negate_ra_state with multiple return paths. */ /* { dg-do run } */ /* { dg-require-effective-target lp64 } */ /* { dg-additional-options "-O2 --save-temps" } */ @@ -38,7 +38,7 @@ int main () } /* This check only works if there are two return paths in test and - cfi_window_save is used for both instead of cfi_remember_state + cfi_negate_ra_state is used for both instead of cfi_remember_state plus cfi_restore_state. This is currently the case with -O2. */ -/* { dg-final { scan-assembler-times {\t\.cfi_window_save\n} 4 } } */ +/* { dg-final { scan-assembler-times {\t\.cfi_negate_ra_state\n} 4 } } */ diff --git a/gcc/testsuite/g++.target/aarch64/pr94515-2.C b/gcc/testsuite/g++.target/aarch64/pr94515-2.C index e73df499070..f4a3333beed 100644 --- a/gcc/testsuite/g++.target/aarch64/pr94515-2.C +++ b/gcc/testsuite/g++.target/aarch64/pr94515-2.C @@ -1,4 +1,4 @@ -/* PR target/94515. Check .cfi_window_save with multiple return paths. */ +/* PR target/94515. Check .cfi_negate_ra_state with multiple return paths. */ /* { dg-do run } */ /* { dg-require-effective-target lp64 } */ /* { dg-additional-options "-O2 -mbranch-protection=pac-ret" } */ diff --git a/libffi/include/ffi_cfi.h b/libffi/include/ffi_cfi.h index f4c292d0040..2beb165c9a1 100644 --- a/libffi/include/ffi_cfi.h +++ b/libffi/include/ffi_cfi.h @@ -46,6 +46,7 @@ # define cfi_remember_state .cfi_remember_state # define cfi_restore_state .cfi_restore_state # define cfi_window_save .cfi_window_save +# define cfi_negate_ra_state .cfi_negate_ra_state # define cfi_personality(enc, exp) .cfi_personality enc, exp # define cfi_lsda(enc, exp) .cfi_lsda enc, exp # define cfi_escape(...) .cfi_escape __VA_ARGS__ @@ -68,6 +69,7 @@ # define cfi_remember_state # define cfi_restore_state # define cfi_window_save +# define cfi_negate_ra_state # define cfi_personality(enc, exp) # define cfi_lsda(enc, exp) # define cfi_escape(...) diff --git a/libgcc/config/aarch64/aarch64-asm.h b/libgcc/config/aarch64/aarch64-asm.h index 83c2e5944b3..d8ab91d52f1 100644 --- a/libgcc/config/aarch64/aarch64-asm.h +++ b/libgcc/config/aarch64/aarch64-asm.h @@ -50,8 +50,8 @@ #if __ARM_FEATURE_PAC_DEFAULT & 3 # define PAC_FLAG FEATURE_1_PAC -# define PACIASP hint 25; .cfi_window_save -# define AUTIASP hint 29; .cfi_window_save +# define PACIASP hint 25; .cfi_negate_ra_state +# define AUTIASP hint 29; .cfi_negate_ra_state #else # define PAC_FLAG 0 # define PACIASP diff --git a/libitm/config/aarch64/sjlj.S b/libitm/config/aarch64/sjlj.S index 6b248f7c040..aeffd4d1070 100644 --- a/libitm/config/aarch64/sjlj.S +++ b/libitm/config/aarch64/sjlj.S @@ -31,20 +31,20 @@ #define AUTIBSP hint 31 #if defined(HAVE_AS_CFI_PSEUDO_OP) && defined(__GCC_HAVE_DWARF2_CFI_ASM) -# define cfi_window_save .cfi_window_save -# define cfi_b_key_frame .cfi_b_key_frame +# define cfi_negate_ra_state .cfi_negate_ra_state +# define cfi_b_key_frame .cfi_b_key_frame #else -# define cfi_window_save +# define cfi_negate_ra_state # define cfi_b_key_frame #endif #if __ARM_FEATURE_PAC_DEFAULT & 1 -# define CFI_PAC_TOGGLE cfi_window_save +# define CFI_PAC_TOGGLE cfi_negate_ra_state # define CFI_PAC_KEY # define PAC_AND_BTI PACIASP # define AUT AUTIASP #elif __ARM_FEATURE_PAC_DEFAULT & 2 -# define CFI_PAC_TOGGLE cfi_window_save +# define CFI_PAC_TOGGLE cfi_negate_ra_state # define CFI_PAC_KEY cfi_b_key_frame # define PAC_AND_BTI PACIBSP # define AUT AUTIBSP From patchwork Tue Aug 6 14:07:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Longo X-Patchwork-Id: 95381 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8BC3C3858410 for ; Tue, 6 Aug 2024 14:09:31 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2612::601]) by sourceware.org (Postfix) with ESMTPS id A0C1C385841D for ; Tue, 6 Aug 2024 14:08:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A0C1C385841D 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 A0C1C385841D Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2612::601 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1722953335; cv=pass; b=gll5arIx+T1j8aNcd6JE3ll2dcfGCrwEeLKDjZw3elW90vYGZC49zaznDTQMeGO3oUQt99Vz01uUmm8vczF4GQQ/C00wpXYgT4afGdGCFPS/9ppNRCuz8YxVX0v2S2twXpfZvvBpwTrXPIN0rousrRgE1uovSjVIBVHGHz0Ll3Q= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1722953335; c=relaxed/simple; bh=n4LepmIpjXuzXH2gw6rvPKwbrj7YCjEB9AAK9aA9Hjg=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=M2RZ/gmu0EdLYJLR6vKKmeEpIMUtXX8qgM+zBUt4El4YM4Wi0C0Wr2pRUvHcrOJBhFJMntG60BvQav7NnBKKgGQG1yr4ch6PKHL8wSXT92Ckjbcawk6ERw1aPr0RvkiW/BQ+w5Ke1pvLWctGITTZu9qtkTMtwSWKAjDg/ZQcobw= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=ytMNu9ojgFvbCf0rUMcWzwnhQ7lw8PqBHvXSPwKHUjPdLKgJ1JGJiH66itWVOA3Y+Bj/+OQZaQdpZk191e1W2OdRLW67dVcM/DPghLC6zFXHITTgZcfLLduhlKayX+h9k7TzDBdI4yF63i8pK1nNahbT6utwBC4Q1vad2lBgblyRYjufiPC64xmUTLcEAgr7sseAL7Yr3SJ9U7bro5huKCxNgXuD/i93qq+XlhzIWi1iBiLHjbvT6UzEt0+PyflTNRzKAIFkH701+98JAX0BmvhziCqE406RS2Xs+uwSInrpg3DTjEg2YxipdKXu2NFFCJPl7EjcO9di5I9cvJ/zvw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=MdnCcF8v6OtQtIh1E/eWEv+HBPBaOa5Hy4WibfBGjxI=; b=rlfaiWQf11V6+QuYre3SzALWRqMiPT/jkGHtCCqQsgVfOPR1L69R0ci+8+/HLZglH0XgcKWVQnqslekmseE/P+4TeAYyiL2ZDJeA37UiAZrfAnXK0j7D6I6y6eItSKIz5OKGCAJQmUW0VTFizN3KVsf+t4y7Pq1529kq98WA0xK0wC76uqkUUMHeBjoce1mHAdp1brIXtCK+tpwHd/vjZNTt+hagb8sgMTtPjKb5mXQUE1i6o3Ilh7PvYS+dAWiAihmeCQ+jdnY5jMZoOhmk2D1lNII2dmzmnUa26vPAKlMcZcLj6RLA02yHfRjLX/6pxJEhXA6LWmLS9LHjVizlWg== 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=arm.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=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MdnCcF8v6OtQtIh1E/eWEv+HBPBaOa5Hy4WibfBGjxI=; b=CLwe0tleyEcU8n9Qp3H5yqg8Jet4k5hy/FMw1kpKJLFkp9TNClnJxyMiQhcyeDsMvI7eQ67QDjkVgvHQcgy7qAXmmvlBbHYQEN0nS7u5pEg72b7ULWZTnDp9X8ZnZmMzHS+dU9bVAWdtn8t/42VbThyvpDeReJJz7rey9SiU/iw= Received: from DB9PR01CA0003.eurprd01.prod.exchangelabs.com (2603:10a6:10:1d8::8) by GV1PR08MB11004.eurprd08.prod.outlook.com (2603:10a6:150:1f5::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Tue, 6 Aug 2024 14:08:44 +0000 Received: from DU2PEPF0001E9BF.eurprd03.prod.outlook.com (2603:10a6:10:1d8:cafe::bf) by DB9PR01CA0003.outlook.office365.com (2603:10a6:10:1d8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.27 via Frontend Transport; Tue, 6 Aug 2024 14:08:44 +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=arm.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 DU2PEPF0001E9BF.mail.protection.outlook.com (10.167.8.68) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7849.8 via Frontend Transport; Tue, 6 Aug 2024 14:08:44 +0000 Received: ("Tessian outbound 6ceac6be275b:v365"); Tue, 06 Aug 2024 14:08:44 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2739788cf8457b64 X-CR-MTA-TID: 64aa7808 Received: from Le143bbabb129.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 29E9BF1B-2692-4FF3-AF56-CFD731879886.1; Tue, 06 Aug 2024 14:08:38 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id Le143bbabb129.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 06 Aug 2024 14:08:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WdpAwEwHVfLDijdrrCZAoZCliGePFLA4/oDRHblNT6KpfjDxvOxCgmIBYtaP1gaeVoVVq4sMMWgdqvae8M8Vb6wNLmR3e3BaEExLqKy9Y+MZDyH24eEvVP5VJ+meIpzDclFlpvKtasxc8oX+GYohrI3YrJIXP/0zruceK0Xs+85nMwJ2ur3APF0BW9D5vAwBZDq9NrxVziRRG7Ug4jsYFqsl1mlBgdndA3B7HqTfyriBH2UUUTR0dHxpwev903RurSWEVgbFUnIBZElWKy5g5FGT0kHa12BaGJYdHiZvD6zTBv78aXpfUk5j14U70vC59okSdo1wgGhwttko9maOQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=MdnCcF8v6OtQtIh1E/eWEv+HBPBaOa5Hy4WibfBGjxI=; b=DQ8Yrzx37gFse/qqfm1JZx8xNWMrbftHiI2Qa4upk5DIfmQRDhRac964GJ1haosszBYQDglt8lD5dinJmR6ixQlXx2L0Uo90ZSwUNWH8QK8OYQ1oVAIkIbiRWSGc10M9BtmZGLeJ3xq+GZKz2l0SUP9AAR3XDsjox/hKxUvR98oXdYVLCsc+7dmDgeR6ezXrxOy0LCuKORs/AK1DeX2Cu2mYcqZvw46XFVDlD3fATM+EzcI3u13hhxn5kSd0vxSG7HGAU0gqJbc+qwoO3x3DMVDTos18MO9h1fNDNCazZwy6ONJpMI8eTVyKCkXVn4jyPZUl5BqyRXJtehyvPdgekg== 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=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MdnCcF8v6OtQtIh1E/eWEv+HBPBaOa5Hy4WibfBGjxI=; b=CLwe0tleyEcU8n9Qp3H5yqg8Jet4k5hy/FMw1kpKJLFkp9TNClnJxyMiQhcyeDsMvI7eQ67QDjkVgvHQcgy7qAXmmvlBbHYQEN0nS7u5pEg72b7ULWZTnDp9X8ZnZmMzHS+dU9bVAWdtn8t/42VbThyvpDeReJJz7rey9SiU/iw= Received: from DU2PR04CA0206.eurprd04.prod.outlook.com (2603:10a6:10:28d::31) by GVXPR08MB11010.eurprd08.prod.outlook.com (2603:10a6:150:1f8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Tue, 6 Aug 2024 14:08:36 +0000 Received: from DB5PEPF00014B8E.eurprd02.prod.outlook.com (2603:10a6:10:28d:cafe::2) by DU2PR04CA0206.outlook.office365.com (2603:10a6:10:28d::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.27 via Frontend Transport; Tue, 6 Aug 2024 14:08:35 +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 DB5PEPF00014B8E.mail.protection.outlook.com (10.167.8.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7849.8 via Frontend Transport; Tue, 6 Aug 2024 14:08:35 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.39; Tue, 6 Aug 2024 14:08:35 +0000 Received: from PW070M4K.cambridge.arm.com (10.57.67.155) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Tue, 6 Aug 2024 14:08:34 +0000 From: Matthieu Longo To: CC: Richard Earnshaw , Richard Sandiford , "David S . Miller" , "Eric Botcazou" , Jason Merrill , "Cary Coutant" , Matthieu Longo Subject: [PATCH v1 3/4] aarch64 testsuite: explain expectections for pr94515* tests Date: Tue, 6 Aug 2024 15:07:43 +0100 Message-ID: <20240806140744.1082602-4-matthieu.longo@arm.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240806140744.1082602-1-matthieu.longo@arm.com> References: <20240806140744.1082602-1-matthieu.longo@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DB5PEPF00014B8E:EE_|GVXPR08MB11010:EE_|DU2PEPF0001E9BF:EE_|GV1PR08MB11004:EE_ X-MS-Office365-Filtering-Correlation-Id: c1235014-edbf-416b-ac20-08dcb621486b x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|1800799024|36860700013|376014|82310400026|41080700001; X-Microsoft-Antispam-Message-Info-Original: q2/wVi8O35OF0LztlVrNgPmSvHQUjW+7v+4VqDI8BXrUduDCWfqyRK04zrvZCGq3hJO7R1HJ+gL6WKccVegD9DA9QDmG2YrTp2pEZ8kZyrY5Ie06JBy0rk1+MPrG1mHyLM/52Bx9nD9tLOXbkkJ3xlaC/WJHfhQ+hCGYjB3wxDKMqj2Q2Ct4LMmJze4ZF+aCJnUuidQ21YX6woU3EodX/w2teBQ5RbLByb6hp9D4N9js8+SEDefMDOFSXEHAx+etv2KW0ESplv8Is/TQQK5SCGjIoeNVraiZXvqNqBtYtSEK82efUalPM1y1VseKtjdVTJ8xQqVlKJQwhDHT7WoqzAmRha0TqGqIhQu/FIZ1TADYHYGOVZFplNla4K9eJxD8PVwq//sOWZecxf6a9F3kbjFOGFuU6AyC3NV1GqEaXLgRTTctDPV1d+8u1tmxqMHNjRrXES3XLVknFvBRx5EPCNuIB25fR/wN9c38k3ChDa96+QCE4pXzebTZk4M/HUVp4I7lqV9XMKzFiPv6C6zgXYaOXFu0oSRyI50Vcy6UbdDdn2WLts2B1223bucytEJwMIaXjuzgVhrsD6EF3myyEhVub5MUmu63trHmH/uWFjIv+xQihQEqZ8b5gTolztwlvrg8Oa4hA49nxaiQUmEudPlJIsTyL3frGV9icZ91EDu+OiVKC6v2U8W0uVCckvj2vEgX0SpHN+hiP6x+NcCskg36rBE1RhVn90dOl+aN/SlZvNrwVK7g+yq6p0GwOGrVBIx2h1Op3Qei1cpiWQSmU4HFgTeqemZt8Lkwz2NC0khXD1JjnS8Pmw0rcklUR/JY7F1lbngzSGb9uXrFBdwACTetL5uPxpGaKcQTvCyA8/aSvNC7UkggXCGGd552wgOS/SVJUozEpVGtiwYY3EGokOJ65H2B3SfEjXGjvZZ3nfnphp67UKvxcrB5dR9zKp+2ule2BWQ8nctf860cVhIlpTu9BcV+xJOtXt+CofiLAikRwkd2QIkd15OSVtFhF12COhxWuj8HSBFeeoY30gf+dmfWvD6N/03sbtTQ2Hr30Xf/C0RS9TI2D6lq9nnpMxO/21Qm3epCXNysepv6reWmLYweA88RP7Gryt6NdkA64VCXfpoou1NYEmyCveD61zR9l7uK/yPPp+GBLJg2/gVPWaLU7gvNvg+uyvoRbpdwGp0u5oddlM7751Wk7Ui+i9AtrXLrEDkEyzuNyc2fmYnmqGCDBcXPEyxVhVbhjhjaUK3UE7ZSfIbHU2afz4lQtfs3ZiEroVJziPO/WuyTOjtL7XRd/8yKhOOZvOQMEyU1mqXK+lGZ48DCjXS4eJVdI8I5Z4lFqJ3zoL6D+2IymsXUHVbryGKuODLlf5lM9wFMlZ86pUwfsoTL83dHR6aN6oYwGB03qmlZI4pGegjtbmcC5qoy0TE4Wvlt0jcrXCAUMmdTBuYXQpL3ki4yVpoj4N34M7F2tiPiBFwBgxOi9YD79A== 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:(13230040)(1800799024)(36860700013)(376014)(82310400026)(41080700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB11010 X-MS-Exchange-SkipListedInternetSender: ip=[2603:10a6:10:28d::31]; domain=DU2PR04CA0206.eurprd04.prod.outlook.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU2PEPF0001E9BF.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 790bd0f1-9343-4e3e-3529-08dcb6214333 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|35042699022|82310400026|376014; X-Microsoft-Antispam-Message-Info: 3hmktQYH588XIPnyjQkc9rfTApqa1FzURbhsk5QCob5WNl1PbHUtP+1aQkj8iVT/6MFj/5BG7tzb6g/S9oH9jNfWx+JSGBPTOlMR1esppYSBk4o7FXChLiEM1g1R4VKYW24zJbKkhONWHH6VjhBJTinelgJPAP7VqsQMit6z57XfAq7HiVp74qotMyCQvydNzJ+G6idY7qdKZ3dx4DE5waKT5iTS3iJT16m4B6yvFPO230FitLgWk00Ro6eu1uK77SvCCu4OMmrX/eNyIstl/2TnMcbkDWS3/v5sWcV0HI9ccVLuFcGjtqXN527e5XxRBanPnIS5V+OXWRrUresZpJaMJLH6ecnERkykZliROUXf9i95BlmFQcrRqFBtuQs7uRvNvhBIfvsIEIP7wLqmoRVphZpinrqPCuVwbBq8plMgM20Jtwe85uOurD0W4Ab+dowCUBDmcePbrJnBDleaS/VKVgIj7T23D6MKCoM54izXih2O6ayj8B8IEohQXyAfx0RfdLZ68FfdcSyCjrVeqTPuPi/rtjiBiLypc1MPhWcn+5888zsGZEGfRsYD4FwclcVarmuU12camsAxLxaabvyvMXfe5wDZZ68SEGWFecSHhAYNArt9/cjCwPLM/1Ma3t4Z2/YQZTaJvK33CUhzpDj87Ly2ZYZakYBaMCv2MJCAWRfjASqUZ84HmlzevTDnlUdYEWR5L58c+ddWlt011G9t7r7R9RgTKpTgqP8AZz3F+jSuVD+3ypD3qp8m0Jk9Pk8+7dWGHZVIVvibaXZagSWaI5N5heS+6+iZHlHgPf/D0H2NfuZgeoDE1kWj4BGeJYU0Iy5jZNJCQbJ7CfwI5flWqpGyGXef0YRNH5gmGzn59idhSTJkjjDThva1K5qVS5//UJnc4T2s9G9I/bVVcz1Ep2Nx7m9UtZ0JVfxjI3gBFabvsnE8+adF21fkWqmTcJKhsEWNkart1zs/JxQQZbTB57BMn/itGfOQqVtnEgQpiWJF+1Kefo+hvhpMTgjf4zM06fIhaNGRBCYgaJ8jI+OA50BE0KcmlcQiT36LDwTpcKT9IRjGNRfuNUb7zumne79a19auSCZcpgMGHGywTLPO8+4i+R0uSSRoQOUo0iwMonQpBxD0ScgFY2JU+JbfKucl7+C54jCZXwPe2xyDQDlKg9tuf9Ey4fHM5wFcT88JcElVX8GKeHnU1jcGEVV6bhwN8FNmB66vRIOkiSB6IU7tuvhuzFLDeauxA+ZyfDf9Sv6SoM0vYrU9cIXb5WxLp+HM8B4GCnIMengx51buBO3rcesheM9c/4sqO8yLOUEVSuuh8j1A00yHJi5de92EB2KCYDbIoU03wSQ3QIyEDvzq7nRTY/BAOrWNVSG1PUksTFyyxP6aybNKUxU/d+b6kaurUhVqTD18fl+YDZ8yKXtbmgnV+fMmQ/2nvrrSQNIu4WOUDuioWJo2INfzt+jf 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:(13230040)(36860700013)(1800799024)(35042699022)(82310400026)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 14:08:44.4803 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c1235014-edbf-416b-ac20-08dcb621486b 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: DU2PEPF0001E9BF.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB11004 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, SPF_HELO_PASS, SPF_NONE, TXREP, 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~patchwork=sourceware.org@gcc.gnu.org gcc/testsuite/ChangeLog: * g++.target/aarch64/pr94515-1.C: Improve test documentation. * g++.target/aarch64/pr94515-2.C: Same. --- gcc/testsuite/g++.target/aarch64/pr94515-1.C | 8 ++++++ gcc/testsuite/g++.target/aarch64/pr94515-2.C | 28 +++++++++++++++----- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/gcc/testsuite/g++.target/aarch64/pr94515-1.C b/gcc/testsuite/g++.target/aarch64/pr94515-1.C index d5c114a83a8..359039e1753 100644 --- a/gcc/testsuite/g++.target/aarch64/pr94515-1.C +++ b/gcc/testsuite/g++.target/aarch64/pr94515-1.C @@ -15,12 +15,20 @@ void unwind (void) __attribute__((noinline, noipa, target("branch-protection=pac-ret"))) int test (int z) { + // paciasp -> cfi_negate_ra_state: RA_no_signing -> RA_signing_SP if (z) { asm volatile ("":::"x20","x21"); unwind (); + // autiasp -> cfi_negate_ra_state: RA_signing_SP -> RA_no_signing return 1; } else { + // 2nd cfi_negate_ra_state because the CFI directives are processed linearily. + // At this point, the unwinder would believe that the address is not signed + // due to the previous return. That's why the compiler has to emit second + // cfi_negate_ra_state to mean that the return address is still signed. + // cfi_negate_ra_state: RA_no_signing -> RA_signing_SP unwind (); + // autiasp -> cfi_negate_ra_state: RA_signing_SP -> RA_no_signing return 2; } } diff --git a/gcc/testsuite/g++.target/aarch64/pr94515-2.C b/gcc/testsuite/g++.target/aarch64/pr94515-2.C index f4a3333beed..af6b128b8fd 100644 --- a/gcc/testsuite/g++.target/aarch64/pr94515-2.C +++ b/gcc/testsuite/g++.target/aarch64/pr94515-2.C @@ -6,6 +6,7 @@ volatile int zero = 0; int global = 0; +/* This is a leaf function, so no .cfi_negate_ra_state directive is expected. */ __attribute__((noinline)) int bar(void) { @@ -13,29 +14,44 @@ int bar(void) return 0; } +/* This function does not return normally, so the address is signed but no + * authentication code is emitted. It means that only one CFI directive is + * supposed to be emitted at signing time. */ __attribute__((noinline, noreturn)) void unwind (void) { throw 42; } +/* This function has several return instructions, and alternates different RA + * states. 4 .cfi_negate_ra_state and a .cfi_remember_state/.cfi_restore_state + * should be emitted. + */ __attribute__((noinline, noipa)) int test(int x) { - if (x==1) return 2; /* This return path may not use the stack. */ + // This return path may not use the stack. This means that the return address + // won't be signed. + if (x==1) return 2; + + // All the return paths of the code below must have RA mangle state set, and + // the return address must be signed. int y = bar(); if (y > global) global=y; - if (y==3) unwind(); /* This return path must have RA mangle state set. */ - return 0; + if (y==3) unwind(); // authentication of the return address is not required. + return 0; // authentication of the return address is required. } +/* This function requires only 2 .cfi_negate_ra_state. */ int main () { + // paciasp -> cfi_negate_ra_state: RA_no_signing -> RA_signing_SP try { test (zero); - __builtin_abort (); + __builtin_abort (); // authentication of the return address is not required. } catch (...) { + // autiasp -> cfi_negate_ra_state: RA_signing_SP -> RA_no_signing return 0; } - __builtin_abort (); -} + __builtin_abort (); // authentication of the return address is not required. +} \ No newline at end of file From patchwork Tue Aug 6 14:07:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Longo X-Patchwork-Id: 95383 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EE2A73857011 for ; Tue, 6 Aug 2024 14:10:35 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2060e.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1a::60e]) by sourceware.org (Postfix) with ESMTPS id 31D4C385C6CE for ; Tue, 6 Aug 2024 14:09:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 31D4C385C6CE 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 31D4C385C6CE Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f400:7e1a::60e ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1722953349; cv=pass; b=xvPSUYdB5u+bK/EG4AzXHNhyd7FC1IZAwrbo/+3ALAniPwrG8CaFI7nvz26GcXT5HE7kZrKziSWuMsl/J+Z9QWMjX4itIZ7iZfY80EpAP38lSseciZ2xY180IDnQr4la8qCNsenhc91kKZHx2PwzwVqna93atQP+8i3dztRQrBg= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1722953349; c=relaxed/simple; bh=uMG55Iprwnd1AUNXkD2yFLgHSr00TtsLQfDu4DLFXYA=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=IJO+qE/eXzxsOSiUuJEmTafrbvuzZXl4HIi8gplC+akm3oQsf+dtocGbSMHTAXPxCusNJBe+8Dbx1nCP1fRCxOtNlFvPQRx8nzaihVmQ9EcSDKqhh5zssz++hzTFgyg8j39NctX7V8U+B7ZJAJlDz3OGZuwGo6zwmdWqzaiKz2c= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=Tcu2IyG/XcVXBQWOMLW0vuD4r808JxOin8HmVxmxPwSJLmFnoV6cTvMHlrliqutJzzHCHWYRZ45rleUPUekk97uq3e8Ptyerfq9ZWzmJF/1uYtvi827U+zbB3C/qigjg6fzNqIAk+f/A45O695MO8/dL1eCaR0u2CP80I+icuXSJlWNf1GeKB7ns8cxfjTZUHN9VSWJqnEVJMwyPpZPS6w8VQXcVhdfxW1B6nDT1kEGwJxr7SGUVb8cD5vsWJ5XbFEklBUCfWAb21tQQ2hdH8IunXagtF4MLSzLPkQCFaz2s4z5JVnPlmNaxuN52uDFqp+5TzpRMW3IHCzYsAsSylg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=+r72ARNGmavgM00lXcJ0RdSljq3LoYTQDE+/bBXi56s=; b=gWh5JVxvnsPhDyWSaidero1IVvUuSZnXpZqaCJUKhnVnNi5hvleIPULR26B5OtauQzWirX+4JlsQX4QYom4dgt8QoGj8G34WNhJA/MeXxFB6K776ifrlbXV2R6/i0LfnSAuEQqboZZFf/YwK4UDcGCC07DhKfoe/u2Jk2P04cEty+e+Uo9kbK6+BOzg3UuMROb8Plks2auYOrjwHfpANOGPSVsvtfriJZI4wIsqRwJEhQw70tpI3NZxbznvLZ7M3hHUN7VDMjFzLCIfx5hqeT+rwakeBP6DC4lITvwwTfg+YmTf5MKxpkgUbiPOE2WLYPPqS8l3dAAsUxrplY5MalA== 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=arm.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=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+r72ARNGmavgM00lXcJ0RdSljq3LoYTQDE+/bBXi56s=; b=eF9yddMbWeHpdoM0GRHpeUAM83WBk7whaocnXAOg2Xc7Vdkq0YF1YmNGB/J2lwBMmqGDXIlxpDZgpF0KjNY7sD8vsCfEWA/eTuCiuW/eKCdXKViaNU+Z1DalSYgRl1Sznd2OBtpd408AKTok25PV9whS+G494yolxWbtCUd+cGo= Received: from DUZP191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:4f9::10) by PAWPR08MB10058.eurprd08.prod.outlook.com (2603:10a6:102:35f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.25; Tue, 6 Aug 2024 14:09:04 +0000 Received: from DB1PEPF0003922D.eurprd03.prod.outlook.com (2603:10a6:10:4f9:cafe::a8) by DUZP191CA0013.outlook.office365.com (2603:10a6:10:4f9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.27 via Frontend Transport; Tue, 6 Aug 2024 14:09:04 +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=arm.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 DB1PEPF0003922D.mail.protection.outlook.com (10.167.8.100) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7849.8 via Frontend Transport; Tue, 6 Aug 2024 14:09:04 +0000 Received: ("Tessian outbound f62a19c28806:v365"); Tue, 06 Aug 2024 14:09:04 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 1463412bc24e69c7 X-CR-MTA-TID: 64aa7808 Received: from L426b9e60dfbc.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4FC34F27-ED02-4D3F-9C16-C32917C76F9D.1; Tue, 06 Aug 2024 14:08:53 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id L426b9e60dfbc.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 06 Aug 2024 14:08:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HJL46AFk2zj4XXWluO1nIYOk0SynTnijvdNZM3BM71d7bzcYicE1jRsROP3WblleO3iK5SXL93TfCBMrdOviDhfh0QIq3oU5DaQsXA888ivW3Hc3v9FpQAHim4P0sMH+rr3ssNQ5GIF6YP/MYNaJxs9+WdSM59J6O3szwT2qLcCi+xr5b9/pkTv2yyDmvxYj0a/BEt9yqZfoaHAp2M+/SgkMBLmMAavGDsjt8mEEC/v+D/YaF0rEDVzJFwSaXDo5kDcLcQ+U3nO91vcJTnLSJETwnclIFcv7wFN5hQDzeulryMChJOhuJiQK7okxVqijoZFUSOgnXwiM96Nv5nIkLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=+r72ARNGmavgM00lXcJ0RdSljq3LoYTQDE+/bBXi56s=; b=QWt18h59AoBLCYgFRs1FS3JdX06TGc7+VD66gufGqL1IsvE3MkheTihAJ2uMHUMZOEd2j9CYq4mx4D6WpU5I0oIPcNymGBP0kHH454ry7FSxxkmhclqhTraRz/Ijsvt5vAtXRG9nnAHiQqKPCUyBBKKpsbJ/cwlJuNVk2f6KUPIz3U2VpGClaML/Ltp0wHDugEEeQwG7fVbWPyS4qb3AhpCQBI5HyOSQ4Z4n99KJUyrlMGnx4Chuw50szUYe2NJiiOIbb9NARz/TRR1PX+LsW19hFlM/tguDyKQzypqMq4wBPECV7USHbjL5PI3vzdgH2CBS0vCNk2TMPwP8TE/06g== 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=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+r72ARNGmavgM00lXcJ0RdSljq3LoYTQDE+/bBXi56s=; b=eF9yddMbWeHpdoM0GRHpeUAM83WBk7whaocnXAOg2Xc7Vdkq0YF1YmNGB/J2lwBMmqGDXIlxpDZgpF0KjNY7sD8vsCfEWA/eTuCiuW/eKCdXKViaNU+Z1DalSYgRl1Sznd2OBtpd408AKTok25PV9whS+G494yolxWbtCUd+cGo= Received: from AM8P251CA0007.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:21b::12) by AS2PR08MB9476.eurprd08.prod.outlook.com (2603:10a6:20b:60f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.27; Tue, 6 Aug 2024 14:08:51 +0000 Received: from AM3PEPF0000A792.eurprd04.prod.outlook.com (2603:10a6:20b:21b:cafe::1d) by AM8P251CA0007.outlook.office365.com (2603:10a6:20b:21b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.27 via Frontend Transport; Tue, 6 Aug 2024 14:08:51 +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 AM3PEPF0000A792.mail.protection.outlook.com (10.167.16.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7849.8 via Frontend Transport; Tue, 6 Aug 2024 14:08:50 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 6 Aug 2024 14:08:45 +0000 Received: from PW070M4K.cambridge.arm.com (10.57.67.155) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Tue, 6 Aug 2024 14:08:45 +0000 From: Matthieu Longo To: CC: Richard Earnshaw , Richard Sandiford , "David S . Miller" , "Eric Botcazou" , Jason Merrill , "Cary Coutant" , Matthieu Longo Subject: [PATCH v1 4/4] dwarf2: store the RA state in CFI row Date: Tue, 6 Aug 2024 15:07:44 +0100 Message-ID: <20240806140744.1082602-5-matthieu.longo@arm.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240806140744.1082602-1-matthieu.longo@arm.com> References: <20240806140744.1082602-1-matthieu.longo@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM3PEPF0000A792:EE_|AS2PR08MB9476:EE_|DB1PEPF0003922D:EE_|PAWPR08MB10058:EE_ X-MS-Office365-Filtering-Correlation-Id: 11e23518-708e-43c1-95e2-08dcb6215477 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|376014|82310400026|36860700013|1800799024|41080700001; X-Microsoft-Antispam-Message-Info-Original: tOztsgte+a/eYvH/aPYvrHGTm08lCLz/5daka0/Q4vwyJdhxdrP0asXKF8j82VoB2Vok2kfM6jfddjlePbtkZAGQStb3hUm5BUduVAa4TsW2xaI9OD0RZd3ePcNysmNPBVO83cbqRYDyMb68TnK7DlWg5DzdEoEKoqVBv95qZtp8r/roZwUJbb5nFDtW1+LAGRN1nsd2i/jgpGuL4tBT2MXTqNqLScTKPdO82bv9r0ZU8LPZfsS8EACGwuxvlJPNryhAuWd3exi1uAV/BLmvESQXHZhPnhniQ1czAZ62vzQlJJwbD+0bSOkPe078lgkK+XW6QsfSPp4f1ET4fHSg22lduRBsziekzzyikzAoln4+YYlRfxnA8phTGtORZSOlmfUnF2SgYUCBVJJXoUpc1v3TvfdJUlrYR1HxavJB2BrQEV2FpMLP7WCktacal87SaIE8bSq61+1mYWRG+CTjALjpOHLad9jOGIX+ObBQmX3VSt/j1cplAOIVL1TtNJJ6nBy2Oa/oCuplvKaR1YSd9a/5sW+fFOkZn3F9m0rSpKjiEcsmZOJO6T/DB8xKOTwBxZy262sc+DS8Buk/Ds8MeqAVTSt1u2x2sGsPwu2W05kDpPjSA+0vzEPfHI35T0gHwOKuf178w0lcgXOfYQ/2ez0Qkv8jlbE2SLS2XxmQcHeYDOOePPKdA6M6fUavh1IAqa3bGVGjwmczXno4AnNBu2rn92PkYL1UIt2tJdjLbqEeIVGFR7jeLXkwVqcU/1IlplSycLWkO5ep13G5V/YFYs6chOYOsNBplyRRVxHpCiDn4vbd2VgzuWzRu7wjtKIvAZRi3ZKLYBOdyZx5KkmkltC6g9mm8X9y9jq9rt46cE/uikkIbo1zTMxYEgtp6dOLozf5kjUsOw+NrJMEGQhyjwKDE/IDVKllG+rom+PTvcttgAQGxgsLE/tXXq0tHs564sWzCfFMW6Qkh7WtwuACpN9VqsTr7JSi8XiOXlPsGUQZ403rJZpAPCHQ81OcLHqAoI4/fCvVqokuPlalchE95Qh927bhAjKLNzJHXP5Skq7SZ09PDFFvcPNR435/FF741N5ciKeWW4eMsNH/Pka05ujaojpkyF/htWSO9Z5o6u69i/d9ECZTY/XoNDDQzS920nSD6kYchCYTszsokVJNEDvFZLnvCr2kJyIMyOKDj1U1seK1M+RQgm77DeZiWI3T4Blt0E2P2iVKybbWA1S4oxV68x19c3F/uXn6hk7dgupX5BMuH+NVFhQiBinfBrCzVAQGsGxWuorkmSOySORDO3TPbON9YCUk4gYFbDGFZ/gTzZniXZd6rCIvfVtxOcXf8aIcpJ+cisXGk3biKnICaGyMarvszBQ5COvGWniWil8ejNAwuIZB1yDP5Iv5bwraRUiYNKyRYwsFwqMx0IaqBpayLYStiH3AdbOcjDo2Mc4V3QZjxuZ0+oGLmzu6AmOeo6YbH9A3jEpZVrc5Rv6bpw== 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:(13230040)(376014)(82310400026)(36860700013)(1800799024)(41080700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9476 X-MS-Exchange-SkipListedInternetSender: ip=[2603:10a6:20b:21b::12]; domain=AM8P251CA0007.EURP251.PROD.OUTLOOK.COM X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB1PEPF0003922D.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 5dbb727d-25d8-42d7-c0bf-08dcb6214c4f X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|82310400026|35042699022|36860700013; X-Microsoft-Antispam-Message-Info: C8FQ/jBX2/SMMoCHjmAtwlB1SZJX95F7eKDXGRgl8yI1TIEjHfM2dVxmj0coyMpjB+G1lDi4qHI7BcuqfrWER3Lauen+Bq9MIqB7xgm1RMBOD+P5/4w/STMmN/1mgrJxt9sJBd3NejejHbgV/awrilbUjORX3xYpm7TNxTxTbX/o6wdJk9328RDcmOuar0lWUSDUGv+ZxFyl41fW4Iy7bhGkVvHahPERMII+QdYkVn5kMuXKNM7kvaC2vauceoX+GAEXPm7+Pa80d2WuaC1Nx5g8vwXB3p3i5ThVFoGud57vLgmmaV3Wbq6DpRio3ACIVunlFvaFp/Tf1RRJCu1N69DrnTFjei414Z3yZqbP2IWEdBX5ch8K3ZEpXlYerOBsePpWX3glg0Cfkr3zItkkbJvcxYPVA+TT07tN7s4wkeBwnQ6p3IcU4iEH8lwVelMReEnEM3Wlfqv19oYimQ3V+r0VUn8APfgn1OBLjOIAewNcYbFqkxLL/ku8b6lkOT5j+8WKEXDzEb38gedQ7qQ5jzj1VNW+cbCy9NNgSmLsi6a80VH00G7TERk0GICySWUswUPK9HW6W/1NmNvCWjEFcJsMm1/JANW/R86uK7MFa+92itvowX8auSLD62Js/kflEPw8zkF0KYhFwIM/Xf7lwvops4FzyLolF5pVOI0S/QdhHLjTEL70OUs8WjrCpfhsQwnV9ncE0rXkzgqB6jjd1UhOU94TQj1ZUXF/ogZYYuYGBfBZp6AtswnzbreYbMYwjywMDyEVSs+A36urZxmcCo546YQWHW2WNlEHTPPH6vrAoXgnRlx8dWeaEUPCq0qc9cCRvLmuWs6pW2ESgvFc+wTZmXFwmgSN4cnV9XdVUJGxHozQh11p7Pf5Z88ORdDL4vmBXGwL3axdioXBjA2W0Y3/F7Zd9iZ3pZNCk2o0MKHzL4g2hRNE+wmGiyP4b4hwX9f+OYio0dRpB9TtOJFQkf52t9AmAun9qd0R5bsHpNQgPMUa873E2UzXkigaNeHaQhWuUayH9OU6WjFsJEzbz0ne8mXoDJfMGscfnOO/YT/M4fXvC+iWbpL56xVA4zffMgAxFv07hXpf3r9ek8HAWRlwZlhF0rw2ulYHzuPdCUmj5B3726odvcfF1dlcpBK4yLZjPUWhaZdbFDhvCmKS3slMtYAeiuWojBry5yfKlf2o2yq8lpG7KUOLyZuGJWM1Ja9h6534Z7OCABIgdCeoUDxbyTl47x5iXYLauBe4qTMrEX7iUx40FCJ1gzAmtnMBzuitgvlwoshFF5ybZUe1gRe/gzubfLRXL4y1VyV6ZDWczxbRtRWG/pDkJgWEG5F5M9JIi/EWaCC8E+/lSt1NfKXFq2G3sHwqTNkIoAJwOlhUGWY7xLTluJ+AZ0PF37yRXzvTkUmTAP/+4WlfUl1eeZeKouo20Cuj/QBwrRzu8aB6uC31sNOdy7USAf0+khTw 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:(13230040)(376014)(1800799024)(82310400026)(35042699022)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 14:09:04.7067 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 11e23518-708e-43c1-95e2-08dcb6215477 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: DB1PEPF0003922D.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB10058 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, TXREP, 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~patchwork=sourceware.org@gcc.gnu.org On AArch64, the RA state informs the unwinder whether the return address is mangled and how, or not. This information is encoded in a boolean in the CFI row. This binary approach prevents from expressing more complex configuration, as it is the case with PAuth_LR introduced in Armv9.5-A. This patch addresses this limitation by replacing the boolean by an enum. gcc/ChangeLog: * dwarf2cfi.cc (struct dw_cfi_row): Declare a new enum type to replace ra_mangled. (cfi_row_equal_p): Use ra_state instead of ra_mangled. (dwarf2out_frame_debug_cfa_negate_ra_state): Same. (change_cfi_row): Same. --- gcc/dwarf2cfi.cc | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/gcc/dwarf2cfi.cc b/gcc/dwarf2cfi.cc index 6c80e0b17bd..023f61fb712 100644 --- a/gcc/dwarf2cfi.cc +++ b/gcc/dwarf2cfi.cc @@ -57,6 +57,15 @@ along with GCC; see the file COPYING3. If not see #define DEFAULT_INCOMING_FRAME_SP_OFFSET INCOMING_FRAME_SP_OFFSET #endif + +/* Signing method used for return address authentication. + (AArch64 extension)*/ +typedef enum +{ + RA_no_signing = 0x0, + RA_signing_SP = 0x1, +} RA_signing_method_t; + /* A collected description of an entire row of the abstract CFI table. */ struct GTY(()) dw_cfi_row { @@ -74,8 +83,8 @@ struct GTY(()) dw_cfi_row bool window_save; /* Aarch64 extension for DW_CFA_AARCH64_negate_ra_state. - True if the return address is in a mangled state. */ - bool ra_mangled; + Enum which stores the return address state. */ + RA_signing_method_t ra_state; }; /* The caller's ORIG_REG is saved in SAVED_IN_REG. */ @@ -859,7 +868,7 @@ cfi_row_equal_p (dw_cfi_row *a, dw_cfi_row *b) if (a->window_save != b->window_save) return false; - if (a->ra_mangled != b->ra_mangled) + if (a->ra_state != b->ra_state) return false; return true; @@ -1556,8 +1565,11 @@ dwarf2out_frame_debug_cfa_negate_ra_state (void) { dw_cfi_ref cfi = new_cfi (); cfi->dw_cfi_opc = DW_CFA_AARCH64_negate_ra_state; + cur_row->ra_state = + (cur_row->ra_state == RA_no_signing) + ? RA_signing_SP + : RA_no_signing; add_cfi (cfi); - cur_row->ra_mangled = !cur_row->ra_mangled; } /* Record call frame debugging information for an expression EXPR, @@ -2414,12 +2426,12 @@ change_cfi_row (dw_cfi_row *old_row, dw_cfi_row *new_row) { dw_cfi_ref cfi = new_cfi (); - gcc_assert (!old_row->ra_mangled && !new_row->ra_mangled); + gcc_assert (!old_row->ra_state && !new_row->ra_state); cfi->dw_cfi_opc = DW_CFA_GNU_window_save; add_cfi (cfi); } - if (old_row->ra_mangled != new_row->ra_mangled) + if (old_row->ra_state != new_row->ra_state) { dw_cfi_ref cfi = new_cfi ();