From patchwork Fri Nov 3 15:36:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 1858955 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=ap9Xm+qv; 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=ap9Xm+qv; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SMPxB0sSyz1yQs for ; Sat, 4 Nov 2023 02:36:42 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7AC093858416 for ; Fri, 3 Nov 2023 15:36:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2042.outbound.protection.outlook.com [40.107.247.42]) by sourceware.org (Postfix) with ESMTPS id 966BC3858D32 for ; Fri, 3 Nov 2023 15:36:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 966BC3858D32 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 966BC3858D32 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.247.42 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699025787; cv=pass; b=BoVU2RtGxelmFXiiSpZkdV+JNbP9ivfzUkutqYSzOFRv3ldFau4jXKbcPx4M5Hw9RYHzt5C/kNjmq5n93TPLVX3wBZbvMvp912l8KdhMDx2P45O4VwNKluYNpqzR+e5F2tgePRGKyvahv1nbLYGf6PBOLBhgPASQ9/rZXWEt+TQ= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699025787; c=relaxed/simple; bh=YKzVvcC2XGE8Ru/3IrGa1ta3Kew17e6UB7KVHldSq0c=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=qUWHEQxTYAscEuczHjc4mm9FCpJ+xgnsikzyDrvykEPfawpmATUyvQblF/OXE8D///kRPWxGwdFOIKalyPJle9vhUVlODPKpCSMOsuJWsOZeNJYnzZPZTHxJFnRT/VGv1wvPiWYas0d+1bCkcC7hPBw/8Zvfwpd9HMnzYr0C6BI= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=d20JYW4vdq4JmdEGE9E3iJz9Pfv0TLFbLXbPVkMRd33uShYQUE2oxV3LKfkSGSrKRwymeXTN2m9ajNAmLlsvHNxfUyp446a+8HH37qulc+b7LXNb/6EFNP62muQWkbDlSjzoVkaFA/cS1eMJ5HlmX7RR3CCJ1XmaqSd8UT/xzq3AhO96DXp4Wb98ZGLxHMvkew9cWB351RwJtf9u/lTARAho8vSOnfbsaQeyNEkyWOb49hQ6m3pO8LI8G23JFt2nQDFQ+Movk7ExyAGHxyd8K/6L5sQM5neaWNKWELGc/4Tf2tXkhS0WB2FedNRpPDBr68Mh72kZwd0QtJEsGM+5sg== 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=/gNx8YLJ21AkxKhV0bGxDNR4mejgSxy0xSK4oBMICFM=; b=UuI7Z8/aH9Mf8wuhn1iWnJ30I1THhKwy+rwhG2M7j727Bk97cKuwZ1CeH/26qYUfOVkCH1C26gNBGruI+LfkKXePA/YstYZxHjH4RpOZnYX5jPgVibgf7+ivKT4YLm2ny+vQUMkBE+oooQw2uGVhmL0AUn1PyDiTmPI2n3X/A/HTu0LQYDnptJ5+eaicJeWf3uR8Pl4sguh7Mq50VwrfLaO8drRCq+KSN7bGWdieJns0Nu+9y2XQdfHU7dDoV2A3XC8siiLlmdht1j6lITku8lzHGVhHNQugq+36eNe0A5EyNTTDicQ5iqul0bdo/7RyMV4UE2xmVomVZt+g8vjQLQ== 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=/gNx8YLJ21AkxKhV0bGxDNR4mejgSxy0xSK4oBMICFM=; b=ap9Xm+qvFN6+4jASxAevImPhAqExmfcjoX0sZQVvXa9sx2mBK9iKUFd3MedzBU5+Ljdum3w3ifOiz7/FAzGHV9ff8FT8l0Ix5EZ+2QkJGNwdOMQ25isXcd2PaTzM3tiNcovvS4CBE/EO3Lg2tFVzQFtNXhxY7apQuAYZLW4Ywy4= Received: from AM6PR10CA0018.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:89::31) by PAXPR08MB7576.eurprd08.prod.outlook.com (2603:10a6:102:23e::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21; Fri, 3 Nov 2023 15:36:21 +0000 Received: from AM2PEPF0001C711.eurprd05.prod.outlook.com (2603:10a6:209:89:cafe::e7) by AM6PR10CA0018.outlook.office365.com (2603:10a6:209:89::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21 via Frontend Transport; Fri, 3 Nov 2023 15:36:21 +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 AM2PEPF0001C711.mail.protection.outlook.com (10.167.16.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19 via Frontend Transport; Fri, 3 Nov 2023 15:36:21 +0000 Received: ("Tessian outbound 385ad2f98d71:v228"); Fri, 03 Nov 2023 15:36:20 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ab7802bffe817f09 X-CR-MTA-TID: 64aa7808 Received: from 06d288aa3417.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A53147B3-9FDE-4BA7-AE7F-7AD97E8B0B5A.1; Fri, 03 Nov 2023 15:36:13 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 06d288aa3417.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 03 Nov 2023 15:36:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QYyaKAVOcL5Eh3UKy24L1mtgOrDShagIogONjnINFwVu404nYADPMb6gbIUkCbBIjpzFTRl27bxla3g9Gtwu5sNFmOcnMP2VlJlZK5QqflEcjkB+dRTjDPg+XU8DByCjsBNhgFQcjlMp/6QnlHbd7E/BHxL9IgJz6N+dUDZ+qZMSDtzFacDYHtwsSk7mN/f6a/j83xune3kocs4K7J4Ef3ggJbX/nfrMw8FwSgvugj/er8+a4sNM8dX+cw1ieIysSRDzcsW3MbbZrEsH02FtgFdjEg1zIKix0ajrQwTimC50bK/+NXI+FbFzuvJZ8w96MUiXfyAkH2Zpc7ZA+UlaPw== 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=/gNx8YLJ21AkxKhV0bGxDNR4mejgSxy0xSK4oBMICFM=; b=X5E+l6e6f7wK1ZN0SnaIG5vjxD1WdzUZCc7EP2F0oZUixtxg9oOtiGgFNQNk6dQUgpag1F44HmKd/RFgdG0pO3mPJC5v+Ajx3HIbQGX4tj3+Zazkeu+PmyPxaBspaTm0QfToe5rim2A9pXInIzLkErbZgV337Bgj7TxCclDjpI5mGk4c2rErCS3OA5OF7X0fS1IV2oOI9n19V6NwW/0cDhhjIdNowOK6/9Yp0B6ltXGLWRCZk3Nuvnd5fGeLfvVMXt1b4RYZNx2sPzUxqxs9LPMEqP4GHHhNLFoXgAMigQQh2kHYWYpFCUd1ldhaAkxqU/3IMNxnQWwF6wXiVSwZ8A== 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=/gNx8YLJ21AkxKhV0bGxDNR4mejgSxy0xSK4oBMICFM=; b=ap9Xm+qvFN6+4jASxAevImPhAqExmfcjoX0sZQVvXa9sx2mBK9iKUFd3MedzBU5+Ljdum3w3ifOiz7/FAzGHV9ff8FT8l0Ix5EZ+2QkJGNwdOMQ25isXcd2PaTzM3tiNcovvS4CBE/EO3Lg2tFVzQFtNXhxY7apQuAYZLW4Ywy4= Received: from AS9PR06CA0715.eurprd06.prod.outlook.com (2603:10a6:20b:49f::34) by GV1PR08MB8379.eurprd08.prod.outlook.com (2603:10a6:150:8a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19; Fri, 3 Nov 2023 15:36:09 +0000 Received: from AMS0EPF000001B0.eurprd05.prod.outlook.com (2603:10a6:20b:49f:cafe::7e) by AS9PR06CA0715.outlook.office365.com (2603:10a6:20b:49f::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21 via Frontend Transport; Fri, 3 Nov 2023 15:36:09 +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 AMS0EPF000001B0.mail.protection.outlook.com (10.167.16.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6954.19 via Frontend Transport; Fri, 3 Nov 2023 15:36:09 +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.32; Fri, 3 Nov 2023 15:36:08 +0000 Received: from armchair.cambridge.arm.com (10.2.80.71) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Fri, 3 Nov 2023 15:36:08 +0000 From: Szabolcs Nagy To: Subject: [PATCH v2 1/7] aarch64: Use br instead of ret for eh_return Date: Fri, 3 Nov 2023 15:36:08 +0000 Message-ID: <3e94445d1e342a47a9676c33376564e112fbc8af.1699025214.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS0EPF000001B0:EE_|GV1PR08MB8379:EE_|AM2PEPF0001C711:EE_|PAXPR08MB7576:EE_ X-MS-Office365-Filtering-Correlation-Id: fd39237d-1a5e-48ab-a264-08dbdc82a136 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: tw0YCLBbH5H/hFaq2p2g8G9bLVcsMLxpvIM1Sm+YLM3Jr2PJ/2shkY17gzX/YX0jAyrRnWMb9KqgTy1CB4uqYOeCOhWtBIsMj4vxPdskp7EhXn+R4sTWVIRa2VFpEFFSa6zDnGLOS2manl66E7BlAW+u0ANFlhKikmULEbhp1xBtQZw/SNX4AvA6jiuKU3m7/IN/a6/SRjM/CkCPXNRAKX5M49c05xAfcQVM2Ky6MGSxcnmapy0eWeCbbyvPBYfi0EgM3YrXtuKbyfQXSottJlhqVgfUZB89IIUvCVjrg3Txzaq9sGddX9jm4BbrdlWSgYp+kJNKczS3zU2d/3t+XRjIpnWs3t7uvmtf2jSNXCuZPMDIMNbKMdFynnOgv0pz8kBdcBMoQpgouWygSf5JnVZmUffd7s4Ic/cX9W0SwTwvnXIzQmxyKvAR+N5WpGjjhYP61hF/eeq0AWSVr0QO/rjmod4YB3kfxjmf4dtRQICTERgoQpMPUU+1eVWj/R5nCttEXeQVd7Yc1V+GcZyHULrU1mEuwUgYIiCPhUJ6AN6Yq1n5zGQ4hK9CyxC8zaoPQNP/418+JXRFxPb+amGHb9+d3kYSjtbotss6mjF3CFxWKgmUyNhngcsGQeENchmW3jqiDXvlK+HaFor1HyVdXxNH91CcBKEJ8Ib16m/O2Oj5TJbID/n0eOwhjfLnbCoprKB9PXBbpXdNCWskODAk16xwjvqDZ90yVT0x1IfaANLCkTJAZka+TJgAf/WP5PTCnxpwDEL6rMwtfHPprDZYOGmdhHnR1mzudeoQhE1AXMk= 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)(396003)(346002)(39860400002)(136003)(376002)(230922051799003)(64100799003)(451199024)(1800799009)(82310400011)(186009)(40470700004)(36840700001)(46966006)(7696005)(84970400001)(66899024)(478600001)(2616005)(26005)(40480700001)(40460700003)(36756003)(81166007)(86362001)(82740400003)(356005)(30864003)(83380400001)(336012)(5660300002)(2906002)(36860700001)(47076005)(426003)(8676002)(8936002)(44832011)(70586007)(316002)(6916009)(41300700001)(70206006)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8379 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM2PEPF0001C711.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c7c409b0-4fb9-4867-8aa3-08dbdc829a41 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Mfh8FUw6qMN2qNbqndKQOmh59966tnpnhVWA9iqHn1jqXQqXDfmP4pa3dWyWsl1Vg69aGcbcsn4tYIK99K6mGfzNoTEH5LbYFmxvawUW292Ie96EHKRdH1s866ByFVB9Nvj+r2veAe/oAbffiriJXu5NoBsCxZwoHxppfZaknKltRXHwxbGKLZkg+lqdhB2wukptbqNOGtN2QfddYnP8wd2g/W+lXgnlFcRyY/jTKIdj6jlu6eXQdnrNeiw4rmkwCWAxfDQYGaCNLtPyrgWux4OyhHzORnosM+LZ8Xkx6UPJckRoAkVxD4pJ8YsiQEzSI05KLWB512PwEcZB80zJ3JqR0yvM94c+1I+gsL8bgiU1/98kUhFvUlr8YGYSBc9MOC0tdthINwzA670WePQa5UwKPBEdYgWtYb87/cK+79MnJ8QFr1D+R7D2+WrD/eI+cG1/OOxmak+4uiWVjeC/6WsEdhirfDB1Z7cZAo9oOeFq5kDCj3yZne53yhU93RzikX8drgn/yhU6DBHatyKUR2cbGsDwM4+UlDxN/gR8H9p6LnZCaK+wdK/qp2oBbNSY3QxGnxjwtZv77gbGvOYTqd0DNy4+19dA9Gbyj2dbVGMnReqWeox4mpGrOAv4urayuBKZqmuUthm4MCvTUc8ywGKgdnBOtO5RXN/lcVufwh1YAXF2kj/w4GxRBLP3y8zQCkXcNW5KE8HR4i5zlmByaax35VjkdIfRVWVlNLpYNVUQoLVM2ugFYvwQTyKKoFtAhE/T8zoflxb4m/2cnaycQA== 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)(346002)(376002)(136003)(39860400002)(396003)(230922051799003)(64100799003)(1800799009)(186009)(451199024)(82310400011)(36840700001)(40470700004)(46966006)(41300700001)(44832011)(316002)(66899024)(5660300002)(6916009)(426003)(40460700003)(336012)(8936002)(8676002)(36860700001)(83380400001)(86362001)(81166007)(30864003)(2906002)(478600001)(26005)(47076005)(7696005)(84970400001)(82740400003)(2616005)(36756003)(70586007)(40480700001)(70206006); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2023 15:36:21.0847 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fd39237d-1a5e-48ab-a264-08dbdc82a136 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: AM2PEPF0001C711.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7576 X-Spam-Status: No, score=-11.5 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 The expected way to handle eh_return is to pass the stack adjustment offset and landing pad address via EH_RETURN_STACKADJ_RTX EH_RETURN_HANDLER_RTX to the epilogue that is shared between normal return paths and the eh_return paths. EH_RETURN_HANDLER_RTX is the stack slot of the return address that is overwritten with the landing pad in the eh_return case and EH_RETURN_STACKADJ_RTX is a register added to sp right before return and it is set to 0 in the normal return case. The issue with this design is that eh_return and normal return may require different return sequence but there is no way to distinguish the two cases in the epilogue (the stack adjustment may be 0 in the eh_return case too). The reason eh_return and normal return requires different return sequence is that control flow integrity hardening may need to treat eh_return as a forward-edge transfer (it is not returning to the previous stack frame) and normal return as a backward-edge one. In case of AArch64 forward-edge is protected by BTI and requires br instruction and backward-edge is protected by PAUTH or GCS and requires ret (or authenticated ret) instruction. This patch resolves the issue by introducing EH_RETURN_TAKEN_RTX that is a flag set to 1 in the eh_return path and 0 in normal return paths. Branching on the EH_RETURN_TAKEN_RTX flag, the right return sequence can be used in the epilogue. The handler could be passed the old way via clobbering the return address, but since now the eh_return case can be distinguished, the handler can be in a different register than x30 and no stack frame is needed for eh_return. This patch fixes a return to anywhere gadget in the unwinder with existing standard branch protection as well as makes EH return compatible with the Guarded Control Stack (GCS) extension. Some tests are adjusted because eh_return no longer prevents pac-ret in the normal return path. gcc/ChangeLog: * config/aarch64/aarch64-protos.h (aarch64_eh_return_handler_rtx): Remove. * config/aarch64/aarch64.cc (aarch64_return_address_signing_enabled): Sign return address even in functions with eh_return. (aarch64_expand_epilogue): Conditionally return with br or ret. (aarch64_eh_return_handler_rtx): Remove. * config/aarch64/aarch64.h (EH_RETURN_TAKEN_RTX): Define. (EH_RETURN_STACKADJ_RTX): Change to R5. (EH_RETURN_HANDLER_RTX): Change to R6. * df-scan.cc: Handle EH_RETURN_TAKEN_RTX. * doc/tm.texi: Regenerate. * doc/tm.texi.in: Document EH_RETURN_TAKEN_RTX. * except.cc (expand_eh_return): Handle EH_RETURN_TAKEN_RTX. gcc/testsuite/ChangeLog: * gcc.target/aarch64/return_address_sign_1.c: Move func4 to ... * gcc.target/aarch64/return_address_sign_2.c: ... here and fix the scan asm check. * gcc.target/aarch64/return_address_sign_b_1.c: Move func4 to ... * gcc.target/aarch64/return_address_sign_b_2.c: ... here and fix the scan asm check. --- v2: - Introduce EH_RETURN_TAKEN_RTX instead of abusing EH_RETURN_STACKADJ_RTX. - Merge test fixes. --- gcc/config/aarch64/aarch64-protos.h | 1 - gcc/config/aarch64/aarch64.cc | 88 ++++++------------- gcc/config/aarch64/aarch64.h | 9 +- gcc/df-scan.cc | 10 +++ gcc/doc/tm.texi | 12 +++ gcc/doc/tm.texi.in | 12 +++ gcc/except.cc | 20 +++++ .../aarch64/return_address_sign_1.c | 13 +-- .../aarch64/return_address_sign_2.c | 17 +++- .../aarch64/return_address_sign_b_1.c | 11 --- .../aarch64/return_address_sign_b_2.c | 17 +++- 11 files changed, 116 insertions(+), 94 deletions(-) diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index 60a55f4bc19..80296024f04 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -859,7 +859,6 @@ machine_mode aarch64_hard_regno_caller_save_mode (unsigned, unsigned, machine_mode); int aarch64_uxt_size (int, HOST_WIDE_INT); int aarch64_vec_fpconst_pow_of_2 (rtx); -rtx aarch64_eh_return_handler_rtx (void); rtx aarch64_mask_from_zextract_ops (rtx, rtx); const char *aarch64_output_move_struct (rtx *operands); rtx aarch64_return_addr_rtx (void); diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index a28b66acf6a..5cdb33dd3dc 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -9113,17 +9113,6 @@ aarch64_return_address_signing_enabled (void) /* This function should only be called after frame laid out. */ gcc_assert (cfun->machine->frame.laid_out); - /* Turn return address signing off in any function that uses - __builtin_eh_return. The address passed to __builtin_eh_return - is not signed so either it has to be signed (with original sp) - or the code path that uses it has to avoid authenticating it. - Currently eh return introduces a return to anywhere gadget, no - matter what we do here since it uses ret with user provided - address. An ideal fix for that is to use indirect branch which - can be protected with BTI j (to some extent). */ - if (crtl->calls_eh_return) - return false; - /* If signing scope is AARCH_FUNCTION_NON_LEAF, we only sign a leaf function if its LR is pushed onto stack. */ return (aarch_ra_sign_scope == AARCH_FUNCTION_ALL @@ -10060,11 +10049,7 @@ aarch64_allocate_and_probe_stack_space (rtx temp1, rtx temp2, /* Return 1 if the register is used by the epilogue. We need to say the return register is used, but only after epilogue generation is complete. Note that in the case of sibcalls, the values "used by the epilogue" are - considered live at the start of the called function. - - For SIMD functions we need to return 1 for FP registers that are saved and - restored by a function but are not zero in call_used_regs. If we do not do - this optimizations may remove the restore of the register. */ + considered live at the start of the called function. */ int aarch64_epilogue_uses (int regno) @@ -10468,6 +10453,30 @@ aarch64_expand_epilogue (bool for_sibcall) RTX_FRAME_RELATED_P (insn) = 1; } + /* Stack adjustment for exception handler. */ + if (crtl->calls_eh_return && !for_sibcall) + { + /* If the EH_RETURN_TAKEN_RTX flag is set then we need + to unwind the stack and jump to the handler, otherwise + skip this eh_return logic and continue with normal + return after the label. We have already reset the CFA + to be SP; letting the CFA move during this adjustment + is just as correct as retaining the CFA from the body + of the function. Therefore, do nothing special. */ + rtx label = gen_label_rtx (); + rtx x = gen_rtx_EQ (VOIDmode, EH_RETURN_TAKEN_RTX, const0_rtx); + x = gen_rtx_IF_THEN_ELSE (VOIDmode, x, + gen_rtx_LABEL_REF (Pmode, label), pc_rtx); + rtx jump = emit_jump_insn (gen_rtx_SET (pc_rtx, x)); + JUMP_LABEL (jump) = label; + LABEL_NUSES (label)++; + emit_insn (gen_add2_insn (stack_pointer_rtx, + EH_RETURN_STACKADJ_RTX)); + emit_jump_insn (gen_indirect_jump (EH_RETURN_HANDLER_RTX)); + emit_barrier (); + emit_label (label); + } + /* We prefer to emit the combined return/authenticate instruction RETAA, however there are three cases in which we must instead emit an explicit authentication instruction. @@ -10497,58 +10506,11 @@ aarch64_expand_epilogue (bool for_sibcall) RTX_FRAME_RELATED_P (insn) = 1; } - /* Stack adjustment for exception handler. */ - if (crtl->calls_eh_return && !for_sibcall) - { - /* We need to unwind the stack by the offset computed by - EH_RETURN_STACKADJ_RTX. We have already reset the CFA - to be SP; letting the CFA move during this adjustment - is just as correct as retaining the CFA from the body - of the function. Therefore, do nothing special. */ - emit_insn (gen_add2_insn (stack_pointer_rtx, EH_RETURN_STACKADJ_RTX)); - } - emit_use (gen_rtx_REG (DImode, LR_REGNUM)); if (!for_sibcall) emit_jump_insn (ret_rtx); } -/* Implement EH_RETURN_HANDLER_RTX. EH returns need to either return - normally or return to a previous frame after unwinding. - - An EH return uses a single shared return sequence. The epilogue is - exactly like a normal epilogue except that it has an extra input - register (EH_RETURN_STACKADJ_RTX) which contains the stack adjustment - that must be applied after the frame has been destroyed. An extra label - is inserted before the epilogue which initializes this register to zero, - and this is the entry point for a normal return. - - An actual EH return updates the return address, initializes the stack - adjustment and jumps directly into the epilogue (bypassing the zeroing - of the adjustment). Since the return address is typically saved on the - stack when a function makes a call, the saved LR must be updated outside - the epilogue. - - This poses problems as the store is generated well before the epilogue, - so the offset of LR is not known yet. Also optimizations will remove the - store as it appears dead, even after the epilogue is generated (as the - base or offset for loading LR is different in many cases). - - To avoid these problems this implementation forces the frame pointer - in eh_return functions so that the location of LR is fixed and known early. - It also marks the store volatile, so no optimization is permitted to - remove the store. */ -rtx -aarch64_eh_return_handler_rtx (void) -{ - rtx tmp = gen_frame_mem (Pmode, - plus_constant (Pmode, hard_frame_pointer_rtx, UNITS_PER_WORD)); - - /* Mark the store volatile, so no optimization is permitted to remove it. */ - MEM_VOLATILE_P (tmp) = true; - return tmp; -} - /* Output code to add DELTA to the first argument, and then jump to FUNCTION. Used for C++ multiple inheritance. */ static void diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index 2f0777a37ac..58f7eeb565f 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -583,9 +583,12 @@ enum class aarch64_feature : unsigned char { /* Output assembly strings after .cfi_startproc is emitted. */ #define ASM_POST_CFI_STARTPROC aarch64_post_cfi_startproc -/* For EH returns X4 contains the stack adjustment. */ -#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, R4_REGNUM) -#define EH_RETURN_HANDLER_RTX aarch64_eh_return_handler_rtx () +/* For EH returns X4 is a flag that is set in the EH return + code paths and then X5 and X6 contain the stack adjustment + and return address respectively. */ +#define EH_RETURN_TAKEN_RTX gen_rtx_REG (Pmode, R4_REGNUM) +#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, R5_REGNUM) +#define EH_RETURN_HANDLER_RTX gen_rtx_REG (Pmode, R6_REGNUM) #undef TARGET_COMPUTE_FRAME_LAYOUT #define TARGET_COMPUTE_FRAME_LAYOUT aarch64_layout_frame diff --git a/gcc/df-scan.cc b/gcc/df-scan.cc index 9515740728c..934c9ca2d81 100644 --- a/gcc/df-scan.cc +++ b/gcc/df-scan.cc @@ -3720,6 +3720,16 @@ df_get_exit_block_use_set (bitmap exit_block_uses) } #endif +#ifdef EH_RETURN_TAKEN_RTX + if ((!targetm.have_epilogue () || ! epilogue_completed) + && crtl->calls_eh_return) + { + rtx tmp = EH_RETURN_TAKEN_RTX; + if (tmp && REG_P (tmp)) + df_mark_reg (tmp, exit_block_uses); + } +#endif + if ((!targetm.have_epilogue () || ! epilogue_completed) && crtl->calls_eh_return) { diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index f7ac806ff15..21bfe160a8b 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -3506,6 +3506,18 @@ If you want to support call frame exception handling, you must define either this macro or the @code{eh_return} instruction pattern. @end defmac +@defmac EH_RETURN_TAKEN_RTX +A C expression whose value is RTL representing a location in which +to store if the EH return path was taken instead of a normal return. +This macro allows conditionally executing different code in the +epilogue for the EH and normal return cases. + +When this macro is defined, the macros @code{EH_RETURN_STACKADJ_RTX} +and @code{EH_RETURN_HANDLER_RTX} are only meaningful in the epilogue +when 1 is stored to the specified location. The value 0 means normal +return. +@end defmac + @defmac RETURN_ADDR_OFFSET If defined, an integer-valued C expression for which rtl will be generated to add it to the exception handler address before it is searched in the diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 141027e0bb4..ee9dc5c5fc3 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -2742,6 +2742,18 @@ If you want to support call frame exception handling, you must define either this macro or the @code{eh_return} instruction pattern. @end defmac +@defmac EH_RETURN_TAKEN_RTX +A C expression whose value is RTL representing a location in which +to store if the EH return path was taken instead of a normal return. +This macro allows conditionally executing different code in the +epilogue for the EH and normal return cases. + +When this macro is defined, the macros @code{EH_RETURN_STACKADJ_RTX} +and @code{EH_RETURN_HANDLER_RTX} are only meaningful in the epilogue +when 1 is stored to the specified location. The value 0 means normal +return. +@end defmac + @defmac RETURN_ADDR_OFFSET If defined, an integer-valued C expression for which rtl will be generated to add it to the exception handler address before it is searched in the diff --git a/gcc/except.cc b/gcc/except.cc index e728aa43b6a..508f8bb3e26 100644 --- a/gcc/except.cc +++ b/gcc/except.cc @@ -2281,6 +2281,10 @@ expand_eh_return (void) emit_move_insn (EH_RETURN_STACKADJ_RTX, const0_rtx); #endif +#ifdef EH_RETURN_TAKEN_RTX + emit_move_insn (EH_RETURN_TAKEN_RTX, const0_rtx); +#endif + around_label = gen_label_rtx (); emit_jump (around_label); @@ -2291,6 +2295,10 @@ expand_eh_return (void) emit_move_insn (EH_RETURN_STACKADJ_RTX, crtl->eh.ehr_stackadj); #endif +#ifdef EH_RETURN_TAKEN_RTX + emit_move_insn (EH_RETURN_TAKEN_RTX, const1_rtx); +#endif + if (targetm.have_eh_return ()) emit_insn (targetm.gen_eh_return (crtl->eh.ehr_handler)); else @@ -2301,7 +2309,19 @@ expand_eh_return (void) error ("%<__builtin_eh_return%> not supported on this target"); } +#ifdef EH_RETURN_TAKEN_RTX + rtx_code_label *eh_done_label = gen_label_rtx (); + emit_jump (eh_done_label); +#endif + emit_label (around_label); + +#ifdef EH_RETURN_TAKEN_RTX + for (rtx tmp : { EH_RETURN_STACKADJ_RTX, EH_RETURN_HANDLER_RTX }) + if (tmp && REG_P (tmp)) + emit_clobber (tmp); + emit_label (eh_done_label); +#endif } /* Convert a ptr_mode address ADDR_TREE to a Pmode address controlled by diff --git a/gcc/testsuite/gcc.target/aarch64/return_address_sign_1.c b/gcc/testsuite/gcc.target/aarch64/return_address_sign_1.c index 232ba67ade0..114a9dacb3f 100644 --- a/gcc/testsuite/gcc.target/aarch64/return_address_sign_1.c +++ b/gcc/testsuite/gcc.target/aarch64/return_address_sign_1.c @@ -37,16 +37,5 @@ func3 (int a, int b, int c) /* autiasp */ } -/* eh_return. */ -void __attribute__ ((target ("arch=armv8.3-a"))) -func4 (long offset, void *handler, int *ptr, int imm1, int imm2) -{ - /* no paciasp */ - *ptr = imm1 + foo (imm1) + imm2; - __builtin_eh_return (offset, handler); - /* no autiasp */ - return; -} - -/* { dg-final { scan-assembler-times "autiasp" 3 } } */ /* { dg-final { scan-assembler-times "paciasp" 3 } } */ +/* { dg-final { scan-assembler-times "autiasp" 3 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/return_address_sign_2.c b/gcc/testsuite/gcc.target/aarch64/return_address_sign_2.c index a4bc5b45333..d93492c3c43 100644 --- a/gcc/testsuite/gcc.target/aarch64/return_address_sign_2.c +++ b/gcc/testsuite/gcc.target/aarch64/return_address_sign_2.c @@ -14,5 +14,18 @@ func1 (int a, int b, int c) /* retaa */ } -/* { dg-final { scan-assembler-times "paciasp" 1 } } */ -/* { dg-final { scan-assembler-times "retaa" 1 } } */ +/* eh_return. */ +void __attribute__ ((target ("arch=armv8.3-a"))) +func4 (long offset, void *handler, int *ptr, int imm1, int imm2) +{ + /* paciasp */ + *ptr = imm1 + foo (imm1) + imm2; + if (handler) + /* br */ + __builtin_eh_return (offset, handler); + /* retaa */ + return; +} + +/* { dg-final { scan-assembler-times "paciasp" 2 } } */ +/* { dg-final { scan-assembler-times "retaa" 2 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/return_address_sign_b_1.c b/gcc/testsuite/gcc.target/aarch64/return_address_sign_b_1.c index 43e32ab6cb7..697fa30dc5a 100644 --- a/gcc/testsuite/gcc.target/aarch64/return_address_sign_b_1.c +++ b/gcc/testsuite/gcc.target/aarch64/return_address_sign_b_1.c @@ -37,16 +37,5 @@ func3 (int a, int b, int c) /* autibsp */ } -/* eh_return. */ -void __attribute__ ((target ("arch=armv8.3-a"))) -func4 (long offset, void *handler, int *ptr, int imm1, int imm2) -{ - /* no pacibsp */ - *ptr = imm1 + foo (imm1) + imm2; - __builtin_eh_return (offset, handler); - /* no autibsp */ - return; -} - /* { dg-final { scan-assembler-times "pacibsp" 3 } } */ /* { dg-final { scan-assembler-times "autibsp" 3 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/return_address_sign_b_2.c b/gcc/testsuite/gcc.target/aarch64/return_address_sign_b_2.c index 9ed64ce0591..452240b731e 100644 --- a/gcc/testsuite/gcc.target/aarch64/return_address_sign_b_2.c +++ b/gcc/testsuite/gcc.target/aarch64/return_address_sign_b_2.c @@ -14,5 +14,18 @@ func1 (int a, int b, int c) /* retab */ } -/* { dg-final { scan-assembler-times "pacibsp" 1 } } */ -/* { dg-final { scan-assembler-times "retab" 1 } } */ +/* eh_return. */ +void __attribute__ ((target ("arch=armv8.3-a"))) +func4 (long offset, void *handler, int *ptr, int imm1, int imm2) +{ + /* pacibsp */ + *ptr = imm1 + foo (imm1) + imm2; + if (handler) + /* br */ + __builtin_eh_return (offset, handler); + /* retab */ + return; +} + +/* { dg-final { scan-assembler-times "pacibsp" 2 } } */ +/* { dg-final { scan-assembler-times "retab" 2 } } */ From patchwork Fri Nov 3 15:36:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 1858959 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=2M8iRw4a; 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=2M8iRw4a; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SMPxv5fpsz1yQs for ; Sat, 4 Nov 2023 02:37:23 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 88713385C6DA for ; Fri, 3 Nov 2023 15:37:16 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2047.outbound.protection.outlook.com [40.107.13.47]) by sourceware.org (Postfix) with ESMTPS id 781693858D39 for ; Fri, 3 Nov 2023 15:36:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 781693858D39 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 781693858D39 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.13.47 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699025797; cv=pass; b=ZAaiftfzRxc4Wh/XNep6VtVrev8EgAmD58CWTUf4YTm6JwImfnT/c6N6Zu9ycMIlCsT336oL6i4sNXiP//5eI/c8lqCkv6EZcufJbBM3i4I6fm8hRvRvUC1dBYsQzdq1pi+LXavGW28v7bEasUi0klQzxRsoL8FPg0JJXjuT9eg= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699025797; c=relaxed/simple; bh=LLaFPrwWUBYtD/08540OwaZFkgRnFPm2NMlHn82Lvrs=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=s/tRgXOq/uEcIVRD8KvWjsF8QhqCWrIhzDsCVhieXaLSqr8pRYnoFfn7DA93i5h+MvACACwQTTTx/mj6uvdyrNZKVBLp0x/x8R2sIWXkLbbrh24ZM6udlU+9yZ3UBWM2v7lRREz/7WCxMiwfCHlpNGmFXblXn+TYYLU9i5CHQzg= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=H2qFWGQg1O6I2M7jDXGznYmmfJ822RxHc+Q0TNAlKgN4yHlHaXZTU3dI2SGXHD/2e1M3FQue9DE/SiWlyQuPAYacaUCqVAqieSBkRxTsyNINavXEJyKIodRijIZUfuihnzrAvAPUZ2t4X7RSWeVhD3ymSZTEuRjWpntS/mDekqM0rK+M1uA/uHPqJnayo9IfMSgvsDFNjFxK9CxUy0xHGVMEMizwXbBISuOitlknXIsuWUMcqhT3GHr0xR3zF+H5nk+J+ct0bmuolXtXAM14hof5+RChAwCLPHsDrpaBwUO0mDNnXYbRqbBSQVs4cnUSXoWt3whWQCCFMeaeLeB4rA== 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=g1EXHzaklNTt5EOoMRSHY/af8crM0JtL9zJCiMnHEaU=; b=cgEnhy4bfUwgNt2p0NcaDqR2TuFjNKLmWeMPgfoeNvzhdOYLRTb4YrVyBWXarmnGEyB1ikjZPzJLTjpwph1LIj6ic7Xr1GdBqmGHsL4nVeH4053pFU/M/ypkTHHNSpeRfx1OwGmt/IBYsQzY15r9EWJRGUCNYthmkBTRfI+aunLn0XV+xLO1/BMUoWPIklb9EcNxwV/jyG4Uw6hBmBvRMmI2WW1Mr39whjQwlO5lFbXrbtFQJNCsq2asZbwLxs8+ywVwRHj/PFhcPbUsIENvuRO7JKgVaZeQ/VDcTja2eLMrGy74U5TVqPXFecilAmZasl0Jezvc/Z82shv8WgGrIw== 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=g1EXHzaklNTt5EOoMRSHY/af8crM0JtL9zJCiMnHEaU=; b=2M8iRw4aUkOOyhefnIZlwf1ZQIm7xnul7XI07YPt41lsmiej7toSjmCPc+lSY4S6cYL+PmtWdoep4xLN1b3LIP9lGUct3fgzJ9BV/ZUeUQgziBhDnaB/C2+pyMU8gkNr623J1yzl5RyURjJuB/11Tk4iSAnCIg3+vltl3DkcFVI= Received: from AM4PR07CA0016.eurprd07.prod.outlook.com (2603:10a6:205:1::29) by PAVPR08MB9435.eurprd08.prod.outlook.com (2603:10a6:102:317::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21; Fri, 3 Nov 2023 15:36:25 +0000 Received: from AM4PEPF00027A67.eurprd04.prod.outlook.com (2603:10a6:205:1:cafe::da) by AM4PR07CA0016.outlook.office365.com (2603:10a6:205:1::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.10 via Frontend Transport; Fri, 3 Nov 2023 15:36:25 +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 AM4PEPF00027A67.mail.protection.outlook.com (10.167.16.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19 via Frontend Transport; Fri, 3 Nov 2023 15:36:25 +0000 Received: ("Tessian outbound 7c4ecdadb9e7:v228"); Fri, 03 Nov 2023 15:36:24 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 35cbf74971a11a6f X-CR-MTA-TID: 64aa7808 Received: from fb6d8eacbeb9.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 524E4F20-30F8-45D7-92DE-9D693FB78160.1; Fri, 03 Nov 2023 15:36:18 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id fb6d8eacbeb9.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 03 Nov 2023 15:36:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QG4iIF5+lZJJmO9hLpP5HvQusuj+timtlwvmuCtoDP3zpBh7Hd86iw+/I9PGeyZeC4D6DQwtIwOY2V0fQr8wSAwitcswdhQD3YYDDiVkjecFrshmfyH91fyq8/fHVHE4EgRRdBpTb2X6r0L4fky3SmTdtuVgibbm8l+tURHDfEr53LF7rN4BP8a7zVJkuLiKxeLzT/xvfpO45lHMQCXEPWmBDwFtScDzen/c5SMlEhZ2b5xcBGuIXupDdO1iq+QrNz53EQK4zNObytMVGL6m1SORGPzdVnrsdhpjczWg3RcUIEGMQQ4AfKbk7eOG+hBrH+tzDpb/FOzLUCnID9Y7ZQ== 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=g1EXHzaklNTt5EOoMRSHY/af8crM0JtL9zJCiMnHEaU=; b=nNrogiMVy9ruC37B63/vGz0PinVCIUOLu8ZMZfdsZi8dJTi3HaG5a5EmuqV35fvZjJ0CYpCtwEmXNqoF4gF3MT8Mt8o6ZflhbdTF2iIMveEnjxO9TrVA4TLcD1wGpUHyU+noY15CxXaLKlKu/6oTH7iyL07g0FoOGRxc1kP63/nhCi3b14kzCSpjAoB2vszGNWsatD3kjfBwwm1X8/DhYTSh710UxcX9KG4YoAEMZshMMCTbbEFJQ/iXfFUT/ND/guXkwJwSHtCVu+ploq5ilGFZ366fW6Xcfl/4irJRlDt9tTTQVqjxTNwhyeaZUGLSqMdkLFbAhk5QBHHwrrS3tQ== 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=g1EXHzaklNTt5EOoMRSHY/af8crM0JtL9zJCiMnHEaU=; b=2M8iRw4aUkOOyhefnIZlwf1ZQIm7xnul7XI07YPt41lsmiej7toSjmCPc+lSY4S6cYL+PmtWdoep4xLN1b3LIP9lGUct3fgzJ9BV/ZUeUQgziBhDnaB/C2+pyMU8gkNr623J1yzl5RyURjJuB/11Tk4iSAnCIg3+vltl3DkcFVI= Received: from AM7PR02CA0019.eurprd02.prod.outlook.com (2603:10a6:20b:100::29) by DB9PR08MB8459.eurprd08.prod.outlook.com (2603:10a6:10:3d5::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21; Fri, 3 Nov 2023 15:36:16 +0000 Received: from AMS0EPF000001B6.eurprd05.prod.outlook.com (2603:10a6:20b:100:cafe::36) by AM7PR02CA0019.outlook.office365.com (2603:10a6:20b:100::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21 via Frontend Transport; Fri, 3 Nov 2023 15:36:16 +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 AMS0EPF000001B6.mail.protection.outlook.com (10.167.16.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6954.19 via Frontend Transport; Fri, 3 Nov 2023 15:36:16 +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.32; Fri, 3 Nov 2023 15:36:14 +0000 Received: from armchair.cambridge.arm.com (10.2.80.71) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Fri, 3 Nov 2023 15:36:14 +0000 From: Szabolcs Nagy To: Subject: [PATCH v2 2/7] aarch64: Do not force a stack frame for EH returns Date: Fri, 3 Nov 2023 15:36:14 +0000 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS0EPF000001B6:EE_|DB9PR08MB8459:EE_|AM4PEPF00027A67:EE_|PAVPR08MB9435:EE_ X-MS-Office365-Filtering-Correlation-Id: 55068b8a-49e0-4379-f3dc-08dbdc82a38f 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: Eddnwl67S5SgK9M44y1yWR/ics0rkDNwC6PHLnGwRT4zAdCHuq6bMQQDHwhNPXIySOtFEgswhGn38a8AGpAUKvMoIapGqi8IH+mDCJ+8sR4HxsmmtNvyg4GDIrmXuJ3gaWYKdU2VdYwVwKo70Ib1H+udadd19r3MlKShyFmpqjh2/irDdtNOnmUCG8Dd+uXXjp9QsltyidC4xsDQ3FUNv4GTvOGd0LRiwBM9ISdru1D+M0TX6VjlQEub8YS5+RDOzUKwHMUivEixWNeTEq98WDSA7QP1iXHl4fLgWtOlKYys2CeoE1JvTmwFDkPYBzwEe3fFqJQagm1cNunhmxvbhgeBIy4b1fOqXgXhyUXq+WQ8NWge0wjj/YxJtPo67MT+pIZlGVRd+GMCzQ7hfNsqtjR5AV/eGLHUyKeeLqBBR50jflaShJtoIcsLzkUDAnux1rlu+sSbJlyxUtTQJJyzwkwbgaduKJ8Oyv7i81e5xupo9JSe9sRTwRpgYjNELsvYYssQ6fwbxDP7bkHsUy5Zz4I40dVcFTYHRy9aAXC+i18+75/uhSJZJN6RbTf1HoAdS6vphaXntzuDlypHfuJ2f17VIzHI/M04U2n3B70x5xh6MuPkfA4DFHmXirTA7m4jtFYBiMIERqsWh0cTOeY1JHMdGwZq5RAnXYbuxJGSVF8d3UABdU+zh32deS74SwVaRHm82uD7NiFTnKtAWke1Z5IbRS9ABaZH4EiKH2aWttxhrqAFaL1NZxWuunfGKAXtt9WE9kO3Ooc+Kq0lczp3IA== 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)(39860400002)(346002)(396003)(136003)(376002)(230922051799003)(82310400011)(451199024)(186009)(1800799009)(64100799003)(36840700001)(40470700004)(46966006)(2906002)(83380400001)(478600001)(966005)(7696005)(426003)(44832011)(336012)(5660300002)(81166007)(26005)(8676002)(8936002)(40480700001)(47076005)(41300700001)(36756003)(6916009)(70206006)(70586007)(316002)(2616005)(86362001)(36860700001)(40460700003)(356005)(82740400003)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB8459 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00027A67.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 48000439-c89a-408d-4063-08dbdc829e7a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AFbkA8bGMKKwIDe+TWtiXXm412u0V04o8YQZyglOcM4WOWyfqFvDhVwMLpId/8JUBF+BhI7mRl2t+V8+9veQt75LXzJiBmwltlV/Vc2iqA8k9rrxXHFZizF1lYh9S8znVGEl4S76wYHt4TYW/pob13D4EDgCD9v5RIEQkJ7GV0PMERcCWoF2QO/hES1jUaevLrJTvKVt4nJ5NamkxEOjiROCFKfyyVm4HW8SFVveZuSyJrSwizAJqK0aHL001ORAaFXQcosfznJs4EV2rdJ05KX4xSOoZ+YBATsdoZ6byGzIqfkEEFCdMj3+TbW8cLViLlSCgpWllTPtCRranhxnXBGM10dHLX6C8f2b8EYJEPWHq5JNeafILQuXvO70NiqWfpgo7HreEbZgL+tAMf8VeG1cB9Nee02Isg+OvGffF4RVjodV4nqVol0G/05d0wEh0WSdFxp7cCM0fHnbxJK7mQlzSddp/aJub0TpP/GorzqP/n/cNBOc4ygiEVoTyc+FhcphllDFvVVoE6YQtl20YDpRvUjoGslql2VYcPQ8ew7N8Yd+hambTKdxKKAIDRO5HcGK3cGgtxJN1V939YtpIeOxGMY27sbHbe4dKeOqejvk7583HkoXtXfvfetX/aGE2tdcY7tgXj3UCYKSJfnrdRZOTgaJ+OjMRvwNNpufgpc5bgSL9NLERhz2mmKld4ryiMb3092wo+SETNTYyrVuL3bIwm8aYCOyaUbmM+6ef2I= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230031)(4636009)(376002)(396003)(39860400002)(136003)(346002)(230922051799003)(82310400011)(451199024)(64100799003)(1800799009)(186009)(40470700004)(46966006)(36840700001)(478600001)(426003)(336012)(26005)(36860700001)(47076005)(2616005)(7696005)(966005)(6916009)(316002)(83380400001)(81166007)(70586007)(70206006)(8676002)(8936002)(44832011)(5660300002)(2906002)(40480700001)(86362001)(41300700001)(40460700003)(82740400003)(36756003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2023 15:36:25.0567 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 55068b8a-49e0-4379-f3dc-08dbdc82a38f 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: AM4PEPF00027A67.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9435 X-Spam-Status: No, score=-11.5 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 EH returns no longer rely on clobbering the return address on the stack so forcing a stack frame is not necessary. This does not actually change the code gen for the unwinder since there are calls before the EH return. gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_needs_frame_chain): Do not force frame chain for eh_return. --- unchanged compared to v1 already approved at: https://gcc.gnu.org/pipermail/gcc-patches/2023-September/629346.html --- gcc/config/aarch64/aarch64.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index 5cdb33dd3dc..88594bed8ce 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -8492,8 +8492,7 @@ aarch64_output_probe_sve_stack_clash (rtx base, rtx adjustment, static bool aarch64_needs_frame_chain (void) { - /* Force a frame chain for EH returns so the return address is at FP+8. */ - if (frame_pointer_needed || crtl->calls_eh_return) + if (frame_pointer_needed) return true; /* A leaf function cannot have calls or write LR. */ From patchwork Fri Nov 3 15:36:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 1858957 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=IK6HCa75; 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=IK6HCa75; 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 4SMPxr1cvfz1yQ4 for ; Sat, 4 Nov 2023 02:37:20 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B68D83861814 for ; Fri, 3 Nov 2023 15:37:13 +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-am6eur05on2077.outbound.protection.outlook.com [40.107.22.77]) by sourceware.org (Postfix) with ESMTPS id 26A133858CDB for ; Fri, 3 Nov 2023 15:36:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 26A133858CDB 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 26A133858CDB Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.22.77 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699025807; cv=pass; b=QGMjaUSUm0KZLw6+NvRtqI0w3HC0WF0LH/nMpIH4QGmLAj58nvh552k47IoVKlRRiXCJR6rOjfzOX5QVG8ludtO5Zgkh9UhEg26APJpuExl4hn8KeOkn4TgVPEtVxkcRFtvdbs8nfUrAKHnwB+VbAma3Nma0zCOqTG1N0TT99gc= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699025807; c=relaxed/simple; bh=HTArN6eBuQR4k4w3HP6EfCl5T/LOniibEudRe0K1rQU=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=DxiCngpRuFi3iWI9qMNxUyxGERBNoRiL4FI0441CF+seiwLl/j0fiLbqL3+cK787+0DZAiWAgPrqIZ53lN8JVija3VqPtsE8JJqqjK2MC61qvGvjUDTr9P3W3royfpZQ6TEE4VrXafVhYfhYz7ODAZha1CfW7299SkMi3ELT4ks= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=S05b3lih15RDfDVoxkYr1i28fz+bUo++eP+cVQy9ywEM7PUlaSO6LFlOpyMVBC4ijSSc8p9isBZDWkilFzK4zLtfwVUWo+hAnxhv1cfZBm2dY7ZYvL9vkiNOLo8M/xek0B18Ygw3RrfEdxE9iB9RjzSMHYBXXDb85DXOiuXne9oB51LZB5FqB1kbHyLdZJ7RPjO2zeVII0Wi9GUT/egZbGWZ5AllzvT7ViAHjc1JZimcY+LyOEUavNUeK2NCpqjPZCaG3RMoGswaC61nzrF4Z59a9gYpciOjJMKzG9a+XEKBYB9dGim6+5f2lc5/Hp/0Sae9q800yOV1IAnDhgV5JQ== 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=6y0HV0dbzGAwIDfMZz9lNDd7XUUwu/CbDWeQ/OB3loQ=; b=Yj+XpUN7YOjb6Kv6N++wHeKQ6p1P6XeKA1/G9klAMqSc5r5IiKhjqFznRr0HLnhkSeT/CyiLn2xXUVdIViXjf4dhzy9AxMnTqzqcIZ4LQOV2e0AQNFzwUoKCKPR5oyLPJbCZup03Ns7hyGDdwpWNmJaEyqYDnuQ/fqJSQILwxZcufOf0EP/xuderp4b0XfzE6ATOhUJo72sKQuiqxOCoC1xbE8dXoG1XBJFt5LxQp/FJDlKzaaIDOVciOzyNxwyL7cFHN0mOvYBzFlom1Ku/W1bu4PIwPb2mRLU7Z8uEKctjylqyp3a4eiTw7OzBV/p+DcoFQM0+7MdxaQiWyDLfNA== 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=6y0HV0dbzGAwIDfMZz9lNDd7XUUwu/CbDWeQ/OB3loQ=; b=IK6HCa75m1MfLlwQPelc29Z6xw5PVuuUO7dxgLW4DbLvy6yRp43bF/yRi4VY4SQGdIVJr0mISgJO+r9Al1Z1c07Yxv61BpyvrB/60/u5N19zuJrtxhN6WMmoAhn4rb1j8DI8Hh8JZhIlXj8K89Pwfm8TSmWMJGcoqEwh2q93sy8= Received: from DUZPR01CA0137.eurprd01.prod.exchangelabs.com (2603:10a6:10:4bc::10) by AM7PR08MB5528.eurprd08.prod.outlook.com (2603:10a6:20b:dd::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.20; Fri, 3 Nov 2023 15:36:34 +0000 Received: from DU6PEPF00009525.eurprd02.prod.outlook.com (2603:10a6:10:4bc:cafe::7c) by DUZPR01CA0137.outlook.office365.com (2603:10a6:10:4bc::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.22 via Frontend Transport; Fri, 3 Nov 2023 15:36:32 +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 DU6PEPF00009525.mail.protection.outlook.com (10.167.8.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19 via Frontend Transport; Fri, 3 Nov 2023 15:36:32 +0000 Received: ("Tessian outbound e243565b0037:v228"); Fri, 03 Nov 2023 15:36:32 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ef94f939fa3d0a76 X-CR-MTA-TID: 64aa7808 Received: from cb8ad73ceafa.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id CE616410-8624-497B-91C3-F6B00989F11B.1; Fri, 03 Nov 2023 15:36:26 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id cb8ad73ceafa.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 03 Nov 2023 15:36:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PcvKDE3LySXnEeF/3nzj3516vB78zQ/4oOb/vCa2heLzOWxxWYJjpFPR4Kgt20ad7gEkgnWPHbnLcjoOCRFnlh80s1NYB/lTH5eJk8efa2gpJrS0zgcfNaR0ZB1swBsrkizwePrbskEQntV+gthKIfDuvONNsUTJ/YqjIJgQtZcoKeglGLw0/fXE7kNdSE5sKShOd0deH2BoVd0UOaXUr+Rx/vLzGpoPw/osfLlwWkHfD/jA1TPGkdFCl2Z2OhMD2c2gjf+eBIjREfTnf0hS2F5Lw/muxzndSSwr+IWCX9E/qDK5OsGbED18kJVkB1H0H/KND9wfkiy2Mz58B7QAZw== 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=6y0HV0dbzGAwIDfMZz9lNDd7XUUwu/CbDWeQ/OB3loQ=; b=knbGhhdTPqGJ/5K+cNe52fJvGwb7yndBpajub+r3dfoIx0w9kWDigAVRglIZfFlFl+MGbeQyBQfZyE+GVM3fTCy0zaUeNEMH876FaiJwQhfs7sGJpE7rIplT2+SxI9n+oaGId9dzTWO850OfqgY07ksjAfEP1bB7GpHQk/mixPyb0dGt7e2yYLv5w3RIJWAGCscF7EDb1DVSHNsNNNRC3RIO4SN6mU7wttPwzTZC/7UlcyQ6QkSBqlH+HN+BZQjHFHg5UfGjV4Q15Pg54jvc1k2yoyCbdYdvFXieawiFvTCjEBz6UwGyZ6MiPn4oSgvIJ89jHGavAw/3LhM5tCtlHQ== 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=6y0HV0dbzGAwIDfMZz9lNDd7XUUwu/CbDWeQ/OB3loQ=; b=IK6HCa75m1MfLlwQPelc29Z6xw5PVuuUO7dxgLW4DbLvy6yRp43bF/yRi4VY4SQGdIVJr0mISgJO+r9Al1Z1c07Yxv61BpyvrB/60/u5N19zuJrtxhN6WMmoAhn4rb1j8DI8Hh8JZhIlXj8K89Pwfm8TSmWMJGcoqEwh2q93sy8= Received: from AM4PR05CA0028.eurprd05.prod.outlook.com (2603:10a6:205::41) by VI0PR08MB10620.eurprd08.prod.outlook.com (2603:10a6:800:1b8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21; Fri, 3 Nov 2023 15:36:22 +0000 Received: from AMS0EPF000001B3.eurprd05.prod.outlook.com (2603:10a6:205:0:cafe::d7) by AM4PR05CA0028.outlook.office365.com (2603:10a6:205::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21 via Frontend Transport; Fri, 3 Nov 2023 15:36:22 +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 AMS0EPF000001B3.mail.protection.outlook.com (10.167.16.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6954.19 via Frontend Transport; Fri, 3 Nov 2023 15:36:22 +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.32; Fri, 3 Nov 2023 15:36:20 +0000 Received: from armchair.cambridge.arm.com (10.2.80.71) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Fri, 3 Nov 2023 15:36:20 +0000 From: Szabolcs Nagy To: Subject: [PATCH v2 3/7] aarch64: Add eh_return compile tests Date: Fri, 3 Nov 2023 15:36:20 +0000 Message-ID: <60a89113beb96fc0183c8ebc2a0dc8d6feb91478.1699025214.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS0EPF000001B3:EE_|VI0PR08MB10620:EE_|DU6PEPF00009525:EE_|AM7PR08MB5528:EE_ X-MS-Office365-Filtering-Correlation-Id: 37938eff-e0de-487a-eb84-08dbdc82a7cf 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: 96nvzi3Wvep/MDGLT0aptEKHux2ASZXFNDmWWKscRfpRuhiQPjFlHrMknU6SZKSjFfUeTZGdkk0oz8LE3aX1UqeRDRpoRhzvK0kVtXFjQEskVdFkETEzqGcXuSvN/gzKQGgTfEfPKh0gHygN0FLlY+5sN+6cSwG1vxaHj55ce+ZIiPR7elkjXJoiOKWuuS9mMrilCNbi00jGnMVwMT9uyxJjT+NO9WUXX6MP6NtLojrtnyJYSG0g6j4sfO9n9AGkeDJepSFHJUdGVEiMVUxv2Eaxsa3SnE0roqsVyl6g0Nn9ToRCUUpNrHTXe05aJr5GfSsoTVt2g5g8FuhIoWoC0Cml4HbI6LJUEsBsRcIDErKKUkGr7M8oKjESYOlKmJVGEAUQAmsS6pNC8OhgWlwqNo/M4h7u6fEltojyOaf11zRZrVafEhzfRlPmWeNGcqka0M1TH1vN5tZtHS4hOrZxwyUlGYM1x7xVVluwJiWnwI1HTZDj4+PBRH1fXoncDmPLj6GIB89g2TFDTrtmKoxVpsge/W0n4U1u0sNHHEkgeSkFTNNOvq+ZNs4u1ohYfPPGjK9jsxJGIcb622p53swMbEb0XVCbmt52FoEbZVC8brKW4MP7mgcNP3LflU24laGlFpVDf7A+5Pn+7lX2oRoa5Kpm4h4vCgW4wzvck9ZEMnFGQ4CbpGir25cc+yoZHgrO1A7lsOj9QcDCej3PSXusLa4d6wT1P1Fc0g0A4sXZQ+Viu5J11mKP7uDATppWsJaHYO8yiHh38ucehJgSk0Jc57vs/NU0leGJ9aFQXpoAmUc= 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)(39860400002)(396003)(376002)(136003)(346002)(230922051799003)(1800799009)(451199024)(82310400011)(186009)(64100799003)(40470700004)(36840700001)(46966006)(40460700003)(2616005)(7696005)(36860700001)(47076005)(26005)(426003)(336012)(5660300002)(70206006)(82740400003)(84970400001)(70586007)(81166007)(36756003)(316002)(6916009)(356005)(86362001)(44832011)(40480700001)(8936002)(2906002)(8676002)(41300700001)(478600001)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR08MB10620 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU6PEPF00009525.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6d68c4ac-cced-490c-de12-08dbdc82a1c0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5d1KsNo9dQk29xxAYT8kd2EpWlkflo4p6ej49l96SRkM65dTmpIo/zzc7SMEjFMy7WZbiiAzYiUrnTMoYp3RdS0eK9Enu03kJJuqtmPd5cUQIcv048dmhB6nclakZZfFAwsYPQbxsQSgZQJb5jz2PvmWYQA2I3C01at5T70wq60adLnQg0XvQF+EWDGXF5HUWA7P7em+v+KoaMQGfMkE4gWqGa/zJaeRz+a3Hpnuep3oXNeMXBE4SrBnJ2J7gSwzXMQS1DxcCbRiDRFovBq4XpwWLZ7VeMCvLpvRuQBebc6WzNaWZnVIPj4/7A79TtPEjAjTRBjgPFqpwjgqQpIVgnq2sbuJkK1WKhkh6OWXNl66EQmjsXk8S7EHgLJEHuIsaoEhyWUHh6rjolSH8yIOAcpzA5v+A45y2zU4m3tHJHLDWZvFLPOTvCkRzit+WPXiJZpSJMkc46X6VwsVRCVJ23XNCQzbzDTUOmfcAjwYRDre08saWUg/J9VeO+uhTb1kT0LZ0LvFaUVMa0T6eYPnxTDa/1J/slTVT0BFNq0CTxkowxtbKw5a3us7NdYtSoEDYjbRY0ok/8qDxeRoh3zIosjs6x02YqKJb6ZMJLVgxIX7wehzUbEfZjXBJD48kvgkvXES/NTl94/un12O8jWGWUHhKj6OLswOu5W51dpjJAtOKDhVIZQlTl/fhs6NycJJ0C2mtuV8WJ76qXSucK3xKgwUjJsxoD2EXRXaFyF1SYB3qER+KsbFn0Mx7BaAsmgz+GfSJy3loeRSAuv0ciLt6A== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230031)(4636009)(376002)(39850400004)(346002)(136003)(396003)(230922051799003)(186009)(64100799003)(82310400011)(451199024)(1800799009)(40470700004)(36840700001)(46966006)(40460700003)(86362001)(8676002)(8936002)(82740400003)(44832011)(81166007)(47076005)(6916009)(36756003)(84970400001)(70586007)(316002)(36860700001)(70206006)(5660300002)(336012)(41300700001)(2906002)(426003)(478600001)(7696005)(40480700001)(26005)(2616005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2023 15:36:32.2337 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 37938eff-e0de-487a-eb84-08dbdc82a7cf 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: DU6PEPF00009525.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5528 X-Spam-Status: No, score=-11.5 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 gcc/testsuite/ChangeLog: * gcc.target/aarch64/eh_return-2.c: New test. * gcc.target/aarch64/eh_return-3.c: New test. --- v2: check-function-bodies in eh_return-3.c (this is not very robust, but easier to read) --- .../gcc.target/aarch64/eh_return-2.c | 9 ++++++ .../gcc.target/aarch64/eh_return-3.c | 30 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/eh_return-2.c create mode 100644 gcc/testsuite/gcc.target/aarch64/eh_return-3.c diff --git a/gcc/testsuite/gcc.target/aarch64/eh_return-2.c b/gcc/testsuite/gcc.target/aarch64/eh_return-2.c new file mode 100644 index 00000000000..4a9d124e891 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/eh_return-2.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-final { scan-assembler "add\tsp, sp, x5" } } */ +/* { dg-final { scan-assembler "br\tx6" } } */ + +void +foo (unsigned long off, void *handler) +{ + __builtin_eh_return (off, handler); +} diff --git a/gcc/testsuite/gcc.target/aarch64/eh_return-3.c b/gcc/testsuite/gcc.target/aarch64/eh_return-3.c new file mode 100644 index 00000000000..bfbe92af427 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/eh_return-3.c @@ -0,0 +1,30 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mbranch-protection=pac-ret+leaf" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ + +/* +**foo: +** hint 25 // paciasp +** stp x0, x1, .* +** stp x2, x3, .* +** cbz w2, .* +** mov x4, 0 +** ldp x2, x3, .* +** ldp x0, x1, .* +** cbz x4, .* +** add sp, sp, x5 +** br x6 +** hint 29 // autiasp +** ret +** mov x5, x0 +** mov x6, x1 +** mov x4, 1 +** b .* +*/ +void +foo (unsigned long off, void *handler, int c) +{ + if (c) + return; + __builtin_eh_return (off, handler); +} From patchwork Fri Nov 3 15:36:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 1858960 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=4MaB+TlY; 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=4MaB+TlY; 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 4SMPyc4ksqz1yQ4 for ; Sat, 4 Nov 2023 02:38:00 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1B8A93857727 for ; Fri, 3 Nov 2023 15:37:47 +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-db8eur05on2068.outbound.protection.outlook.com [40.107.20.68]) by sourceware.org (Postfix) with ESMTPS id 795C53858296 for ; Fri, 3 Nov 2023 15:36:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 795C53858296 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 795C53858296 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.20.68 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699025810; cv=pass; b=AccTcdWT77lw+85xcdTL/4c0VBnrIuMbR86UUe+CgiWsWew/XK/vJvPD1wzQiW7JQCDuen0hwMiqHq+cZL8YMEz27Ns9Y3vI+bCBQRecS77M16nHolL04pjEh8goXEHgG5+QDyx/LUoQsTaiaQa2ts8VyHtiDjYtSsdpJQlc2EU= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699025810; c=relaxed/simple; bh=zZG5eK72XWqjFq+n9YUOXsRPu7lxPjhifv8SflybElU=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=rW3ul/lfSRgJSCETULrHbXjMiaTjM/S9b21zyHkeAiY916nmH/JxoDrxuX+A5LJigmeG/3jMav+k+cXUC66q4KUENtSKj9iBGhH79w/K7e/zK5hi7t/O5Uag0QHBYMEj8giGYTW0mmJUCHgaQxobAJkQFiJRZ3JdxylsOME+P3A= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=HkCqBo8JL4rE8Wm4r/yjLt2+R9tXSBHz6+u1l28bWLZIk9Lh9azWzUmcvk99WP1n0fNrCLuAiWZbxZFMDPEdSVwxnb0WAImplKndsl5bvV0sqI0DSpe9FCLw9vxavrkmGHvSuoKuAN+OI1XQdCIF7kPkThpL2deLeXjhPb5ufkKK8O+uLeM7Fn+JXmA5bgyGWsgDkicYy28MHKtyfrpcVX/LS5q8rEJIcJ4pvkIACbdmG7sxSZJKbZ6QrNjMUZzBjBAnFTiqB+Od49OtJNSeGV9GskqqXI+yj3j9nf27jTz+kfCqNIm9xWwlc9ALKGXtZaITHq/RzBC66mZhMs3s2Q== 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=55mT6d2yh4wgrnFgvKvLY+Akv+X0ecMXxsu/8+nCjlk=; b=VO0oacM1v1TKAw0LgIxj9mix6xT0eVzFg9aPdEiucTPZJcDrk88qHknRjqtAWnWD7yUWHfZPA4ZOboqrtXVTRXVqNWAU5E7t77mlxcXbmUeLolliN7aA+Wa3FMWjfblM0eZfOQZHRrfjangIq9xSvofQVEO6WknlYLSNLc8gaWBz42XwsLD9Met9XUAZ82Pp1WEVIBwovpCUvPVRvXl9yqNzacDVny1eyV1gdZ/hk133KVw4xSSujl6snibOKeD7g0HnnvaKGkcXXyms6rtWU2t8pP4+3b83SVGOu1dgNpQbUHkFLShzlHndZVTosJh/cZt3z1UOmbCY7mjQ+8sKew== 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=55mT6d2yh4wgrnFgvKvLY+Akv+X0ecMXxsu/8+nCjlk=; b=4MaB+TlYunoI09HhfWBgEJWSH2iphlWmW7WJYv8N8wC7Wsc5JGSXMajkDzpicB1CI/NavVJ147BdtX3A0mUBO5DJElJGnvT9lZiwSrUU+49Y1TfUnVc1vMMqRRYtuR1nYUyVrTMgqm1sSpck050oJfM5aGK2LI2ylgTfgtBEAIc= Received: from DUZPR01CA0042.eurprd01.prod.exchangelabs.com (2603:10a6:10:468::9) by DB9PR08MB7842.eurprd08.prod.outlook.com (2603:10a6:10:39d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21; Fri, 3 Nov 2023 15:36:37 +0000 Received: from DU6PEPF00009523.eurprd02.prod.outlook.com (2603:10a6:10:468:cafe::26) by DUZPR01CA0042.outlook.office365.com (2603:10a6:10:468::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.22 via Frontend Transport; Fri, 3 Nov 2023 15:36:37 +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 DU6PEPF00009523.mail.protection.outlook.com (10.167.8.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19 via Frontend Transport; Fri, 3 Nov 2023 15:36:37 +0000 Received: ("Tessian outbound 8289ea11ec17:v228"); Fri, 03 Nov 2023 15:36:37 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 1d0b399bd612b4b6 X-CR-MTA-TID: 64aa7808 Received: from 9b991c10fe09.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 21A9C100-2AB4-4086-9501-8FC8FE975098.1; Fri, 03 Nov 2023 15:36:30 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9b991c10fe09.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 03 Nov 2023 15:36:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mUN8bNixs6IouiYnznER5QsgNLL/F3Fzx5GnNA5LCYcG4HJ62+qbLdt87mtvbwsTrq9p/9ibM+Qy1k8Zeq+1tPCG8YWEQXTsPZ8G91pH1zl0qQRP76gozTSPgnHtVgPp4cZ2fGs2oDp2+bFH6MVqvQlCQ9fEKXN4vzKv+HgarGqebGQv+baiyoJjwkMBIABknOqgMZUNXX4NyAFllVHNkbxwt+VRJV/CJI5dujoKSvluRfn86PXjWgztCuUiVxOts6G0x+5cwv348fsXX4tFTOlWWUsm6+zmB0VYuzfv4/8BQkS5YTexTHuuZT5DUNOSLL5S+d7CZV3aXhtBfAKIYw== 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=55mT6d2yh4wgrnFgvKvLY+Akv+X0ecMXxsu/8+nCjlk=; b=kW0ndyWvbQaS5w4QQsBPpVrihKfGrlyo2SbDNHKPqyeoWnV3gWM//H7tocloywAQwJ05WEkE2nrynHzyWf5nEp6WW18uT/skXMJiuinDoXFu3/yme+QD/u1dulvzxBlw2fmmL2OtCcrdumkJBnD76XnDaRXmqMH4uvPHDKe8cGkV8X7BuRDc3D49tPvuEvrWBS0qbExkXQgjcdd43Y1jQQDehpQ7CLS8taJLrdudAu9HdwdP8oJ3kT21P/+asdNLBmTIBzp+y6KQxpZ4Ar3tuM//3Q6DQwMSYSOhk5de3hmE/h89mR6/FdQfhH8h5P7x8PTrIFrAJTgnNcBbyVflbA== 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=55mT6d2yh4wgrnFgvKvLY+Akv+X0ecMXxsu/8+nCjlk=; b=4MaB+TlYunoI09HhfWBgEJWSH2iphlWmW7WJYv8N8wC7Wsc5JGSXMajkDzpicB1CI/NavVJ147BdtX3A0mUBO5DJElJGnvT9lZiwSrUU+49Y1TfUnVc1vMMqRRYtuR1nYUyVrTMgqm1sSpck050oJfM5aGK2LI2ylgTfgtBEAIc= Received: from AS9P251CA0005.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:50f::17) by PAWPR08MB9995.eurprd08.prod.outlook.com (2603:10a6:102:35d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19; Fri, 3 Nov 2023 15:36:27 +0000 Received: from AMS0EPF000001B2.eurprd05.prod.outlook.com (2603:10a6:20b:50f:cafe::f8) by AS9P251CA0005.outlook.office365.com (2603:10a6:20b:50f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21 via Frontend Transport; Fri, 3 Nov 2023 15:36:27 +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 AMS0EPF000001B2.mail.protection.outlook.com (10.167.16.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6954.19 via Frontend Transport; Fri, 3 Nov 2023 15:36:27 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) 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; Fri, 3 Nov 2023 15:36:27 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Fri, 3 Nov 2023 15:36:26 +0000 Received: from armchair.cambridge.arm.com (10.2.80.71) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Fri, 3 Nov 2023 15:36:26 +0000 From: Szabolcs Nagy To: Subject: [PATCH v2 4/7] aarch64: Disable branch-protection for pcs tests Date: Fri, 3 Nov 2023 15:36:26 +0000 Message-ID: <448b7663e4422d8ee68c2744544567484f309bd2.1699025214.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS0EPF000001B2:EE_|PAWPR08MB9995:EE_|DU6PEPF00009523:EE_|DB9PR08MB7842:EE_ X-MS-Office365-Filtering-Correlation-Id: 54a369e7-7830-48a1-7b5d-08dbdc82aac7 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: akOWQm97nkraNCLVv8jZnd2WY6zeCTA6WJA6IoNyO/tkomthl8UKarAVGASKopDkuoodVhbBbpXZEtMH31givcWu4POGYM4QD4lgpALPHGxPey9HJC6gCOh5NFXt5UDFCTCKTIxwPAw2ybxWyHqOgf77DS42G0cEitPLXnQmVtCA6f19RJhSL5B0rGL1GRsxo1/1pI5Xt0zrcxmeANGGPvTtYoiul77FFEc/KZRV5VDV0NMxpHc8BUq+sQ9kkULO8Ih4jHVwwZH1it9WkfkgZOKvtdTU5obSDDulVeIxKv4xJLoyU30IE74t1IVhrNRs/nB2EykPaJqhXRJmsPTH/p8YycEhZ7jVzDCcN1Cbttg+VCGaLcr4Ma11x+FZCOqshW16Edk1x5vxcwBmiwW11Ph1o48zE6XDhU8sWwsTvsHc9OTihGGFqV33GYg/VoDAlPvcVFGSW8pb8Y06uS1M1mp4yte0C07XT4E/0ijIdDBtT/P7zdcWuCTdTiyIP7QfGQjgg8lRfOopWm5m3BGHPhsB2OwBTuI4QZB/E2JfGD5T874OzBbJUwxKWOZIQLgAjpLWRd07DUJaFjLDvqlAGsU/G6KzT8mMY+K6VpVbfccl4KjYVvD8qXXYBriUgXicF/TsCA/sQZ8iaUkhETWtkHTMaQOSgXYFAfcIFhT4rK0jhc0wElAUWdCAEcCeMbtm8Z487tRW60y9x0L2gLBnB9Q7Es240dmRz6Jhn1kbAjYEahsF+oN11RCmV8N+lMJjxu6JCKXBqTCPF5OxfzpWomzU9a7YZk5b83MUeiKXHq4= 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)(39860400002)(376002)(396003)(346002)(136003)(230922051799003)(1800799009)(82310400011)(451199024)(64100799003)(186009)(36840700001)(40470700004)(46966006)(84970400001)(26005)(2616005)(40460700003)(2906002)(478600001)(40480700001)(356005)(86362001)(81166007)(36756003)(82740400003)(316002)(426003)(336012)(8676002)(47076005)(36860700001)(44832011)(41300700001)(966005)(5660300002)(6916009)(8936002)(7696005)(70206006)(70586007)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9995 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU6PEPF00009523.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a8d0c93b-c16d-49f5-0d95-08dbdc82a4eb X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z8Gg46zh3E1ODNzkchHtnoFqi/Byip7iZaolvaV2I2OaJGZ2B7cqyRbN1v0HKQZeJ+HCaja3J8LAT9FuD0z/ohknjzXOG9HJz0Kh2EcqIgxVzTXXhaPfzJ4P6/Qxqc5YaiN3obztcbpUSI1nf1G/+Y7ep5qqk+1o6Cko4sV3CUAP6x38WphTA5z7VbcTFYPeomPQ3HEOE4HX1qlESnVE5+4gMB+pyec5Zrc9wsPkHLtQmjbiMGpvSuypnP2Xcbitti2W8sv+HYaYA3Otk5xqyvHOuOG2SGeVVVMww/2QXbjFLyuSGBzQwZwfTCXYPTV1v4Uv8k3Q7rIizL6fxnaA7MKpfUnZ+sVNK7DPWRt15jUI2+R5o4XgBtft+6ef9nIKWu41yTOkVdMMrzVsmzj91wgr4ub9CY98f+H2ITop/4fpr9qm+AsjwNTCPRecKqboCOSIc9Q6uot385Qt64kKo0i2BIU9O7NVWWHdt/MrhST6yozQ6uD5/eA/RxenKhyhBIWvcbssl1HpGre2UmlnZfRd1O7wnugjTL/vs9FbnBNKnErDJujkmHCpKbNMW4LM9/5SKNpZCOfFECMaYSzPa4V89lSefm/+XYE8wYYH30rxMBxwpMgU/mM9ijClpSFLdi64C40vVzpthpwg6FfUaa/JcenRep+XPMEL0xSqw+LDwXJj4YOEJa00GKs4ytoY+TPttOJgrLXe/vbdh7rZ8wiSL1BwiqUiz/b/mgXNXxQR8RH+y5PL2+R+eY5HBCHOo0cAHRBkMNp5wETCSA2W/A== 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)(39860400002)(136003)(346002)(396003)(376002)(230922051799003)(82310400011)(64100799003)(1800799009)(451199024)(186009)(40470700004)(46966006)(36840700001)(478600001)(47076005)(41300700001)(36756003)(86362001)(966005)(40460700003)(2906002)(7696005)(81166007)(84970400001)(8676002)(8936002)(26005)(426003)(336012)(44832011)(70206006)(70586007)(6916009)(2616005)(316002)(82740400003)(40480700001)(36860700001)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2023 15:36:37.2116 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 54a369e7-7830-48a1-7b5d-08dbdc82aac7 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: DU6PEPF00009523.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7842 X-Spam-Status: No, score=-11.5 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 The tests manipulate the return address in abitest-2.h and thus not compatible with -mbranch-protection=pac-ret+leaf or -mbranch-protection=gcs. gcc/testsuite/ChangeLog: * gcc.target/aarch64/aapcs64/func-ret-1.c: Disable branch-protection. * gcc.target/aarch64/aapcs64/func-ret-2.c: Likewise. * gcc.target/aarch64/aapcs64/func-ret-3.c: Likewise. * gcc.target/aarch64/aapcs64/func-ret-4.c: Likewise. * gcc.target/aarch64/aapcs64/func-ret-64x1_1.c: Likewise. --- unchanged compared to v1 already approved at https://gcc.gnu.org/pipermail/gcc-patches/2023-September/629353.html --- gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-1.c | 1 + gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-2.c | 1 + gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-3.c | 1 + gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-4.c | 1 + gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-64x1_1.c | 1 + 5 files changed, 5 insertions(+) diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-1.c b/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-1.c index 5405e1e4920..7bd7757efe6 100644 --- a/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-1.c +++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-1.c @@ -4,6 +4,7 @@ AAPCS64 \S 4.1. */ /* { dg-do run { target aarch64*-*-* } } */ +/* { dg-additional-options "-mbranch-protection=none" } */ /* { dg-additional-sources "abitest.S" } */ #ifndef IN_FRAMEWORK diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-2.c b/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-2.c index 6b171c46fbb..85a822ace4a 100644 --- a/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-2.c +++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-2.c @@ -4,6 +4,7 @@ Homogeneous floating-point aggregate types are covered in func-ret-3.c. */ /* { dg-do run { target aarch64*-*-* } } */ +/* { dg-additional-options "-mbranch-protection=none" } */ /* { dg-additional-sources "abitest.S" } */ #ifndef IN_FRAMEWORK diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-3.c b/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-3.c index ad312b675b9..1d35ebf14b4 100644 --- a/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-3.c +++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-3.c @@ -4,6 +4,7 @@ in AAPCS64 \S 4.3.5. */ /* { dg-do run { target aarch64-*-* } } */ +/* { dg-additional-options "-mbranch-protection=none" } */ /* { dg-additional-sources "abitest.S" } */ /* { dg-require-effective-target aarch64_big_endian } */ diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-4.c b/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-4.c index af05fbe9fdf..15e1408c62d 100644 --- a/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-4.c +++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-4.c @@ -5,6 +5,7 @@ are treated as general composite types. */ /* { dg-do run { target aarch64*-*-* } } */ +/* { dg-additional-options "-mbranch-protection=none" } */ /* { dg-additional-sources "abitest.S" } */ /* { dg-require-effective-target aarch64_big_endian } */ diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-64x1_1.c b/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-64x1_1.c index 05957e2dcae..fe7bbb6a835 100644 --- a/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-64x1_1.c +++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-64x1_1.c @@ -3,6 +3,7 @@ Test 64-bit singleton vector types which should be in FP/SIMD registers. */ /* { dg-do run { target aarch64*-*-* } } */ +/* { dg-additional-options "-mbranch-protection=none" } */ /* { dg-additional-sources "abitest.S" } */ #ifndef IN_FRAMEWORK From patchwork Fri Nov 3 15:36:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 1858956 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=vxX5FJgh; 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=vxX5FJgh; 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 4SMPxk6ck4z1yQ4 for ; Sat, 4 Nov 2023 02:37:14 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 122A53857BA4 for ; Fri, 3 Nov 2023 15:37:09 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2057.outbound.protection.outlook.com [40.107.7.57]) by sourceware.org (Postfix) with ESMTPS id C45163858D39 for ; Fri, 3 Nov 2023 15:36:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C45163858D39 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 C45163858D39 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.7.57 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699025816; cv=pass; b=mppLYGFWx41B8n1h8OqQI8vSaQEUVDxXhtgTCKVXDEXFIdI7TLMczn+Rea1FomXqq3CKRp1j++VzTyIYa2jjGcstYY9iqdydzPWo8mPOXdO8iZUdTT5b94jtgh3wNejDF12vtlwaJdyGdg0D8UPQaQyCqwtSnr8EgK7ZMmTbock= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699025816; c=relaxed/simple; bh=DpZGxcrWa22Jkcj06j3u6daGAAlg8evE6djoBNvDVJE=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=Z5W9jOwoHL4JVOB6AI5m5xnAtXyRmk/gin0dByg9HouxRgPfC15DXr69/Lu1xAolBVyiKGdzp+cfcMAJDiGDvhy7qFAEGbqUzJNRoh5VTD5CCUPNKkSyejA0PxtNZ17muzlu66AmHYpmm1+pAKmEwyFt192Dg9Opxwf4p10jPmA= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=DuzarS+ziQNT4yV5UfT6mHLfXpVHaAoAh+JO+uWfmTum9KufLjypoo+BtBBGVrye+NDj1C4SqzXH3Xyud+h1eoFqi3IrFxkDdKxXCnevKjjYwW7gifngZNXDsxfymek2KIk7QYLRIYm578AkpM8vo7JKBFelTs3BAoA+zmtuJuDSy2Z5lKTjNkN2aBstvDO4NA61YrF50UJBWBJM33vYPNEB8ZeafLeTAhDF57fyo1iqPdZvim8ujOocjg9HUrMAVez1K+PNqbCMNAIsMZ1DRodk+Wb6bM7JfIHctlAvDSX4yEw3wAohittvXOuciAY1Xqb/+zYhgB/2IYjWk3cfow== 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=F4q9unvZmUtJ0Eaw4piLkSRdZev3w13TJMxDdPHMb/c=; b=gIK4Il8cBoYTB9/Xq6/UzE5GSjDFPe2UBsfuAup/gfYcMpIJMqIh9ENOiAH5Zuz0YzGFcQyL3q4mACRkp85ichNda67qIzchVcPpe89ZT+lsicz0XTa1OPFL3FjSIgAy9qKWp0f0Ns/HLgKSosrAd5a7ybhIc13VG6DFkRfqlXDxtoakThvejVv7u5egCBI51+t8WMVodNEMwE8PammufYt5VZdf07JpIzkuuonhU0YotRfQ4/uq37WT4O1VfkGqJ5VfEJg0adPjMhiFNkHeY744g9RuML8m/ibffgs/9HBVqDxEiiDuJKIUS8gFrA21KT6CS3lBKFaGdeNxoa1nrQ== 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=F4q9unvZmUtJ0Eaw4piLkSRdZev3w13TJMxDdPHMb/c=; b=vxX5FJgh50e5vy1sPwA7KEjjltJ7D1phj8m8NY8o85z8hnGTcFBqel5BfaOjkdMdr5Tx2w/ZRSf6TDOT+LgJuJM+NeXHH1hnX8XMoajVOKVE5zoITvSxje1/CA/0U1ZS4AkjO+gartxhIboEg6sA6czly/RWZsNxA/la9gPkPMQ= Received: from AS8PR07CA0048.eurprd07.prod.outlook.com (2603:10a6:20b:459::22) by DB8PR08MB5482.eurprd08.prod.outlook.com (2603:10a6:10:116::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.29; Fri, 3 Nov 2023 15:36:42 +0000 Received: from AM2PEPF0001C716.eurprd05.prod.outlook.com (2603:10a6:20b:459:cafe::59) by AS8PR07CA0048.outlook.office365.com (2603:10a6:20b:459::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.10 via Frontend Transport; Fri, 3 Nov 2023 15:36:42 +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 AM2PEPF0001C716.mail.protection.outlook.com (10.167.16.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19 via Frontend Transport; Fri, 3 Nov 2023 15:36:42 +0000 Received: ("Tessian outbound 5d213238733f:v228"); Fri, 03 Nov 2023 15:36:42 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2545605babbdbae2 X-CR-MTA-TID: 64aa7808 Received: from abc0e71c5094.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 09A3DDA2-EDC7-43DF-825E-178854F9BB0D.1; Fri, 03 Nov 2023 15:36:36 +0000 Received: from EUR02-AM0-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id abc0e71c5094.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 03 Nov 2023 15:36:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kmTZ2CVUVx6Pel8WrVeTUPoORAEtP8lKTtUtmvNrcjCFS4qj0FX7IkjlMu/MsXWH71L/lN2gFPQnJdMMNeHIGuR4+5L9dNM/xmf1yQFkc7jbm4gyOgPL2QeMi24DwnbfcDAUuh3+IcuFJlOvlKX32WMqV+xUmoR/Fz1KujjzPfJFFYX5MW+B2Tij7homT93chCqTMzB+87P6dxu9l5swKMgEFAvAdikFEJKsWQYcO3LgdDk0T6iXnR+ZVlmQNZlgW24DKrYrZr/nK5B+ffXhmImvBhCOl8L6U++3o42tzrRxpEa+6TEtuYqZt+/nxOC2059WA2nNviOoiTtUaiwZiw== 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=F4q9unvZmUtJ0Eaw4piLkSRdZev3w13TJMxDdPHMb/c=; b=jOOXWuHO1kplLdglCk6EOURcLRdPgjQ90qPyCM/I807f+VlaOdUKHq3CTPtuJZkPVAQgBk7vAl6KPPuHuKWKibRvaD3AF7/ZE+FCBAiw+4SfRTwCXdHhLRKImFvKg6LEYSyUUwmbQtLaIIiumAIBXBbtUXA0WR6zo2EABChHUD08M8XB6CJ+up2KKbRat1vGYTp6MC1bVXZfvVC6Qm1TIXe9BoKuUkcIy0aEQrM5UoJTwK0buxYmVG/Jwk6nBWyjgwaCHOOdOeOWVN2oQelu4cNGa1j9MCeIeKDLW59W0NmJnmLfTyLdLmKgMiLzPtGuKohPIbzI71pTdVawF6Jnnw== 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=F4q9unvZmUtJ0Eaw4piLkSRdZev3w13TJMxDdPHMb/c=; b=vxX5FJgh50e5vy1sPwA7KEjjltJ7D1phj8m8NY8o85z8hnGTcFBqel5BfaOjkdMdr5Tx2w/ZRSf6TDOT+LgJuJM+NeXHH1hnX8XMoajVOKVE5zoITvSxje1/CA/0U1ZS4AkjO+gartxhIboEg6sA6czly/RWZsNxA/la9gPkPMQ= Received: from AM6P194CA0003.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:90::16) by PAWPR08MB9832.eurprd08.prod.outlook.com (2603:10a6:102:2ea::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19; Fri, 3 Nov 2023 15:36:34 +0000 Received: from AM1PEPF000252DE.eurprd07.prod.outlook.com (2603:10a6:209:90:cafe::b1) by AM6P194CA0003.outlook.office365.com (2603:10a6:209:90::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; Fri, 3 Nov 2023 15:36:34 +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 AM1PEPF000252DE.mail.protection.outlook.com (10.167.16.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6954.19 via Frontend Transport; Fri, 3 Nov 2023 15:36:34 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) 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.32; Fri, 3 Nov 2023 15:36:33 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Fri, 3 Nov 2023 15:36:32 +0000 Received: from armchair.cambridge.arm.com (10.2.80.71) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Fri, 3 Nov 2023 15:36:32 +0000 From: Szabolcs Nagy To: Subject: [PATCH v2 5/7] aarch64,arm: Remove accepted_branch_protection_string Date: Fri, 3 Nov 2023 15:36:32 +0000 Message-ID: <8ebe0679d0d92c8c39bffc98e1f30e2b29770e00.1699025214.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM1PEPF000252DE:EE_|PAWPR08MB9832:EE_|AM2PEPF0001C716:EE_|DB8PR08MB5482:EE_ X-MS-Office365-Filtering-Correlation-Id: 8e3e7c3f-0f1d-4dd2-9119-08dbdc82ae13 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: ZwjOkBk48cKCUfPIoSAniBj63JtYXAUNK76w7XgaE8InXuB+fbdqjpxqkCJIWDcgPUhIhuTPv/YBx4ft4W2qnq7GaCiS4AQZ0ve3zJNcgh+Gp/MI79jXAodaAlME0muK8l8QCJnT+6/nFjvvANQOBqIYT9r6ogHokzpPjglMDavhKT6AoLfxsu9Vfx06qELZOBuVTT1Q81Cq/I4sFQrDD1SdtMIhrcomNCQMgK6eigMQmT1s2ls7BCO5S1u3Ct3AoPQ7K3Is44FQ5q3T+jcavhuJxp75R+8jn4VQhhtUz6pr8qFhmVQxz27QpwWLjkmbDx03A4g1+EDm7WiED9lsczRvsr6sP89EcgawYKUCCrdbIcYtTxYkorOnGOoo+IUbS78bYuPTRk34VdqR2DKo1dTa6NIXetHP+RlOOc2URC+FmY8Au3jNlWVjn+e9/vBSqSWKd3/IA0zlshQ+Snc57IHrKRu/jo6RB2h4tfy3+Aegm+BGuNejWe18swGkdvdjyMLOagjeKAauId6qgst5NTopZDZB1H9pjh4nUhl+IIC8MgXWa9Rj/j9VAPxGJxWpJj8EePuG9Qfq6P4kNudH0g53QXHOlI/Cn2MRl+/LXXTDDbtWhEAS5PIu4wKjwfzm6hZJWNwlPkRdFxtpl7at1RrzDlyfA05uPsr7htJhXpDK9TThMpcZicofbHaepqCeatl95ojcLLL70YstJVQcXNIeADIUUEOUiHPv1rabHqmKe5BrFO2S2b+rwpY2nt8a7CjbwtKA/jVM/wCEdFyNzA== 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)(39860400002)(346002)(376002)(396003)(230922051799003)(64100799003)(451199024)(186009)(82310400011)(1800799009)(40470700004)(36840700001)(46966006)(83380400001)(40480700001)(2616005)(26005)(36756003)(40460700003)(81166007)(82740400003)(86362001)(356005)(2906002)(5660300002)(36860700001)(336012)(426003)(478600001)(47076005)(7696005)(8676002)(316002)(6916009)(8936002)(44832011)(41300700001)(70586007)(70206006)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9832 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM2PEPF0001C716.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 99b698e9-5f83-436a-6d77-08dbdc82a941 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CA/xeevJd3PZ9FFj2XiSs65SLUVGVZayjgOVbptsgalp01yCo/txRWrXDitCnC6MY0qDMWjk0BOn+d0/d4W8mlrHNaqXkke21WUXQlVVR+QNjHCuH05Unf+5Kz5KOwRF6QcwZdmUT4SAH4ew9nFsMzR/pFCuEDMJs4IqSWFzQb5FxRjVTe2WLXySu6zQwg4SJoljQa304ouWcZVtony4g7LiCinmI4xOOMKH59rPUuDWTTvjbIv93H1gWD8NuBX5Lxc0M7HOUQwURsTkG6Ni+WMqZy4pWzYbjFdYBEKLQHjBse5OLx/EHM/PtH09zis83ghTZUDlLPtdTHdZ6XDvY/y9D//5R+rhDWl8s3NoYp0JJMfNil0FCIljXYQyfXyr06NNhM38ZNPz19JLdwMRSIRpOSu7uyLnNQaha6NnQptF1V4z5jxmOu4b9fRIaUYK6VQCMrqEbVpcxiJb+TFFi1YKWcY6bq1gOW/Bthn0wmPWE2Zfa5G1Bjn3H1P9MlC4iClLZMeK6H2SZdxaJtDWtBp+n30Jite8SMcoPc/ouf8aGieKvp8D0NoM2ufOHNWQJRvq8qFo0vQ/AOAxylI0IwfHnLrV5CrgZCv2oeP6wVdH0SZ+TWfY6b6lUR8/c86i7L2REGX26M0UYeqYMtYsKc3+hc6zqu7P08Ot4SyNV/cfpA+uYMYZav1TQ8hbT4N5z8QFHr3kG7NcwJf8PdALla5FRPlIqEW1ybXTrBPFh1X+e8FsXKyweMQqj2b6hW4X 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)(396003)(376002)(136003)(39860400002)(346002)(230922051799003)(186009)(451199024)(1800799009)(82310400011)(64100799003)(46966006)(40470700004)(36840700001)(86362001)(82740400003)(36756003)(40480700001)(40460700003)(2906002)(8676002)(8936002)(44832011)(41300700001)(7696005)(478600001)(83380400001)(2616005)(70586007)(70206006)(5660300002)(426003)(26005)(316002)(6916009)(81166007)(336012)(47076005)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2023 15:36:42.6965 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8e3e7c3f-0f1d-4dd2-9119-08dbdc82ae13 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: AM2PEPF0001C716.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5482 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org On aarch64 this caused ICE with pragma push_options since commit ae54c1b09963779c5c3914782324ff48af32e2f1 Author: Wilco Dijkstra CommitDate: 2022-06-01 18:13:57 +0100 AArch64: Cleanup option processing code The failure is at pop_options: internal compiler error: ‘global_options’ are modified in local context On arm the variable was unused. gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_override_options_after_change_1): Do not override branch_protection options. (aarch64_override_options): Remove accepted_branch_protection_string. * config/arm/aarch-common.cc (BRANCH_PROTECT_STR_MAX): Remove. (aarch_parse_branch_protection): Remove accepted_branch_protection_string. * config/arm/arm.cc: Likewise. --- unchanged from v1 --- gcc/config/aarch64/aarch64.cc | 10 +--------- gcc/config/arm/aarch-common.cc | 16 ---------------- gcc/config/arm/arm.cc | 2 -- 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index 88594bed8ce..f8e8fefc8d8 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -323,8 +323,6 @@ bool aarch64_pcrelative_literal_loads; /* Global flag for whether frame pointer is enabled. */ bool aarch64_use_frame_pointer; -char *accepted_branch_protection_string = NULL; - /* Support for command line parsing of boolean flags in the tuning structures. */ struct aarch64_flag_desc @@ -18101,12 +18099,6 @@ aarch64_adjust_generic_arch_tuning (struct tune_params ¤t_tune) static void aarch64_override_options_after_change_1 (struct gcc_options *opts) { - if (accepted_branch_protection_string) - { - opts->x_aarch64_branch_protection_string - = xstrdup (accepted_branch_protection_string); - } - /* PR 70044: We have to be careful about being called multiple times for the same function. This means all changes should be repeatable. */ @@ -18715,7 +18707,7 @@ aarch64_override_options (void) /* Return address signing is currently not supported for ILP32 targets. For LP64 targets use the configured option in the absence of a command-line option for -mbranch-protection. */ - if (!TARGET_ILP32 && accepted_branch_protection_string == NULL) + if (!TARGET_ILP32 && aarch64_branch_protection_string == NULL) { #ifdef TARGET_ENABLE_PAC_RET aarch_ra_sign_scope = AARCH_FUNCTION_NON_LEAF; diff --git a/gcc/config/arm/aarch-common.cc b/gcc/config/arm/aarch-common.cc index 5b96ff4c2e8..cbc7f68a8bf 100644 --- a/gcc/config/arm/aarch-common.cc +++ b/gcc/config/arm/aarch-common.cc @@ -659,9 +659,6 @@ arm_md_asm_adjust (vec &outputs, vec & /*inputs*/, return saw_asm_flag ? seq : NULL; } -#define BRANCH_PROTECT_STR_MAX 255 -extern char *accepted_branch_protection_string; - static enum aarch_parse_opt_result aarch_handle_no_branch_protection (char* str, char* rest) { @@ -812,19 +809,6 @@ aarch_parse_branch_protection (const char *const_str, char** last_str) else *last_str = NULL; } - - if (res == AARCH_PARSE_OK) - { - /* If needed, alloc the accepted string then copy in const_str. - Used by override_option_after_change_1. */ - if (!accepted_branch_protection_string) - accepted_branch_protection_string - = (char *) xmalloc (BRANCH_PROTECT_STR_MAX + 1); - strncpy (accepted_branch_protection_string, const_str, - BRANCH_PROTECT_STR_MAX + 1); - /* Forcibly null-terminate. */ - accepted_branch_protection_string[BRANCH_PROTECT_STR_MAX] = '\0'; - } return res; } diff --git a/gcc/config/arm/arm.cc b/gcc/config/arm/arm.cc index 6e933c80183..f49312cace0 100644 --- a/gcc/config/arm/arm.cc +++ b/gcc/config/arm/arm.cc @@ -2424,8 +2424,6 @@ const struct tune_params arm_fa726te_tune = tune_params::SCHED_AUTOPREF_OFF }; -char *accepted_branch_protection_string = NULL; - /* Auto-generated CPU, FPU and architecture tables. */ #include "arm-cpu-data.h" From patchwork Fri Nov 3 15:36:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 1858958 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=B6JdcBSE; 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=B6JdcBSE; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SMPxv0xv4z1yQ4 for ; Sat, 4 Nov 2023 02:37:23 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 249043856DE2 for ; Fri, 3 Nov 2023 15:37:16 +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-am7eur03on2056.outbound.protection.outlook.com [40.107.105.56]) by sourceware.org (Postfix) with ESMTPS id C4B0D385782B for ; Fri, 3 Nov 2023 15:36:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C4B0D385782B 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 C4B0D385782B Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.105.56 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699025822; cv=pass; b=Ye6lFoPTZC0rMBSeQMQgPQw6kY7FHoJcKPl4pxEl89I7KVypDmW4iy9oW5A0Wk/ygMHdD9HsaZjSzIuQ1ZxxoFp+bWc6An27AIITtoMBvr+xaGV/7kEy5BMQT6HQ8e+EbKzGQZQ6YeQAgnwK6W7YkCtWdeYl8m2LbRmjb8NUH+o= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699025822; c=relaxed/simple; bh=5PgI3H4QW0RibeMgDjtKrTxngfhu5Y2oZEmRNWop8ts=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=gSEPajaWSlf3bC99n7YSsLOkTpn5LIAS0Nfh0HZpE7wCiRDL8ddQz2B3KqqRFJLAbFsgvCa3wJZ51TAJ+n5twJgHqS1Zmg+edyDNPZedPuKdIEpKj89wiy9hywtsLjgBMoTCHah+s5kBi8D6OhlTGkIv/onCVMG814oamihP34g= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Q5BoUh+vU5hctZto3FznJ8tX5y1qh8qGOX4NjBePyr4J4eiqSiR2o32IFRNdK0uRlPh6wyhVkX3GT6ir8WUwjGzMbaLo+kI/x+Hm0Xg90X6NXTvPGO9+0lodqTns1SrYKt8vgTTIreGOWFP75cWLQZjmiBvjbBokDXwOzx6EsskTmeWAsurjqid1lkz+1+smr/Lt/Xujbdvh5uNFXwBw8LuVpR8yebuX984pRqSbtuPdM3aG9C0Oyyd+8Dos8LBWUtv4ewIa1mouAhdoX2Wy/UOizFbJnM5szXB2cA1TqcneHJ8RRRn2V7IQEDOUK+PHDm2HLUYYtMyzxK+xgHrskw== 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=DaC2dKVG1B1Uu3gP8j0Hg/TbL/0dwxW1hKXjK3eJCAw=; b=BTQEw06a6Nv56ZHcnkPGoNuafKMWf/kr43eTWM2OjYJuQDuceno17fb7n4g+1KIFGVJuRQmYuE6wwGYvSW3+6tZCwCrsdOs8PXKI/BR7ovz9qfctHrV83fQNxL8VG2zmHyG2lY1iCsv5x0AY6Pq7JqMe6b6l4ZGS96Npn+bFXienlyuID3OaE1Rqxbx77CooXU407UdNvj8Lgx6V+wK6iI4Z8x/Tj2pQw+l65pobIV2MmAzqJwCLhug0n3iiZeNYeARUQqfsgA0Leffg+oXZozp7eB2o91o+xs/fdvdm/Pjbu4ojDjXkyw9d04MEPrNe38F3WicLpEuI2EY5jV3oHg== 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=DaC2dKVG1B1Uu3gP8j0Hg/TbL/0dwxW1hKXjK3eJCAw=; b=B6JdcBSEdntq+9Dh7Y/Va1hV87avOUNswVAsvw+hok5vO9F+vjZI8cKEJ4+UH39qKBa4TTPHo05sZ6BsOwbg9KxkLB+Trlow5CxDgIVH1KStGdP3U9zczIEhQSXQ4rZ0ITJA25UEzDVw9vvR9DSDIhbKSpeuxn7h/7X31u3viFU= Received: from DB8PR06CA0039.eurprd06.prod.outlook.com (2603:10a6:10:120::13) by AS8PR08MB9362.eurprd08.prod.outlook.com (2603:10a6:20b:5a9::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21; Fri, 3 Nov 2023 15:36:49 +0000 Received: from DU6PEPF0000B622.eurprd02.prod.outlook.com (2603:10a6:10:120:cafe::7) by DB8PR06CA0039.outlook.office365.com (2603:10a6:10:120::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.29 via Frontend Transport; Fri, 3 Nov 2023 15:36:49 +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 DU6PEPF0000B622.mail.protection.outlook.com (10.167.8.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19 via Frontend Transport; Fri, 3 Nov 2023 15:36:49 +0000 Received: ("Tessian outbound 7c4ecdadb9e7:v228"); Fri, 03 Nov 2023 15:36:48 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 312157a517788791 X-CR-MTA-TID: 64aa7808 Received: from c302e2a62c7c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3C3389C7-32BE-443C-B47A-FB59C0F03BD8.1; Fri, 03 Nov 2023 15:36:42 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c302e2a62c7c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 03 Nov 2023 15:36:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=foKzqFwCG/TAABqOE8J25C2iMJg0HRRPFixhcrgMRfMmQaxXnxjSt+BsZoiB96Y541EMQo/vlD6epx+p8g94zmEQmlBR5Xomjyut3lrGNvLnqMaR8FbznjgPDRVBB/uv0XgsFUSWvS0yErtPccITV4+PnWuGYdB+8Ftw3uftUz9T38m4PKbV1MBby2/OHp129rpU3KR04KtJYMR/HZMbBarhD4rb78uvijEsfPUFMb33TI8kqGFJfTYaGrxvd1x73a1w/zHK6uDO5DInVfJbTJxTSc0aM8aIxCgLTXag5XSkF1++sf+zC3CsKjPhOpjb/wTsIuMoUphbcj7dcFaTSw== 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=DaC2dKVG1B1Uu3gP8j0Hg/TbL/0dwxW1hKXjK3eJCAw=; b=efRfonIEfqMzyXCQBHowEC+YSxB9gbXGAAmEraJJ8+hJ12Okz6fMAFUquk4Xgy8aC8zgMUS5VRspK3Xm99CigsxraXb36L9Pzj5ei6q3A5gbf7lU6Mi4cdOty1ustTKfXDVUqtDzCYi+8jXtBlbpJw+WEdxGsUDzt2toRy5Wdro7YdjksQIJFPdDlOyxIgvM5DMV7F2v7tn6QxXwDEHmP9BeEFyygmkpYlIWL9n1v/C5uq0gLfciVNy4nJPQT9TiXewH5MqrK0afACRGw+nh1W2yeDBBQGDt3dT+c4btp+GE1W3qxzfhwnfMaenr3XCmH6HGgAK2ioLBQ/qApWYrsA== 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=DaC2dKVG1B1Uu3gP8j0Hg/TbL/0dwxW1hKXjK3eJCAw=; b=B6JdcBSEdntq+9Dh7Y/Va1hV87avOUNswVAsvw+hok5vO9F+vjZI8cKEJ4+UH39qKBa4TTPHo05sZ6BsOwbg9KxkLB+Trlow5CxDgIVH1KStGdP3U9zczIEhQSXQ4rZ0ITJA25UEzDVw9vvR9DSDIhbKSpeuxn7h/7X31u3viFU= Received: from AM6P194CA0011.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:90::24) by DB9PR08MB9849.eurprd08.prod.outlook.com (2603:10a6:10:462::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21; Fri, 3 Nov 2023 15:36:39 +0000 Received: from AMS0EPF000001B1.eurprd05.prod.outlook.com (2603:10a6:209:90:cafe::98) by AM6P194CA0011.outlook.office365.com (2603:10a6:209:90::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.22 via Frontend Transport; Fri, 3 Nov 2023 15:36:39 +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 AMS0EPF000001B1.mail.protection.outlook.com (10.167.16.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6954.19 via Frontend Transport; Fri, 3 Nov 2023 15:36:39 +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.32; Fri, 3 Nov 2023 15:36:38 +0000 Received: from armchair.cambridge.arm.com (10.2.80.71) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Fri, 3 Nov 2023 15:36:38 +0000 From: Szabolcs Nagy To: Subject: [PATCH v2 6/7] aarch64,arm: Fix branch-protection= parsing Date: Fri, 3 Nov 2023 15:36:38 +0000 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS0EPF000001B1:EE_|DB9PR08MB9849:EE_|DU6PEPF0000B622:EE_|AS8PR08MB9362:EE_ X-MS-Office365-Filtering-Correlation-Id: 0313f8db-d678-4fe6-4cff-08dbdc82b1cf 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: Dyqz8PKrFfoa/KlxBDXefofZ4+jU73Q+A/uApu3AkUhVxUuYTFKHXxahSC4YhZnj6vUk//ZXAm72lcetMuybl/LqZxaVQ53ag495nuJVqRKbWA9VUQlN5/uGQku8crqfYhv+yVJm9f//4SncZ+uzCmFkxPg3EqnWRGqCsNJpwfjc2PGB4ESgVbS6zSB7RXa5Uw4F8s/P5BdfTpzVCYfUTntpXjbPp92FcIg9+F0KMfGiXeMJixHVW5TkUFxv3MzXooDWz0J2NhahHuzrr24s9GRv8uZ7lseb/0YnI2Q8FJMelkBR5MRkuQy0OtYCJd2CBZtUUsFskrVXIhZsWv0qbpX15uRCwGpcXAXHRYRUU8cCbpSjdYoHsegvW+IdZMR45ffrOO6BxPe+LMi9z2QlzBGHxxp8vmXMZC6E//9DOfBhe9LiiNNQ1e8/azdDasWLrq5buutgamVHOYKSdoImZUTugLcMErwQPPYuAOIV0NMx74fbYdXW1MICqaWeOn3m68J3ntwqitBFByL6BVc7QxZWlhJrPtS3lhFEfEiwA1mdzj8RXhX8EWvgYpiGF42zHd6kHtwMhEPwe31FinqAj9QiwE7z4Mw4pfGtqUg4Tb4sk4YVSgQ4EfvN4tKkrO5TJoUbndF0O26KIWBxNn7nzAR4otQu9g3sexv22VRLiBH4Y0eaz2a1Yd5c8e5ILa64a2J9Z5zeTKffyHFCVFLF6dY1zocgH10F6+7/d9l95nz/aD5Hmf506LAU13PrZIGfjxbKRj4xhMce+oLTU2+TZe19gWKncpjtoFj2r6cjeNo= 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)(39860400002)(136003)(346002)(376002)(396003)(230922051799003)(451199024)(64100799003)(1800799009)(82310400011)(186009)(36840700001)(40470700004)(46966006)(40480700001)(40460700003)(26005)(2616005)(7696005)(47076005)(36860700001)(83380400001)(2906002)(336012)(426003)(478600001)(8676002)(30864003)(41300700001)(70586007)(44832011)(5660300002)(966005)(70206006)(316002)(6916009)(8936002)(36756003)(81166007)(356005)(82740400003)(86362001)(84970400001)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB9849 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU6PEPF0000B622.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 41a01b01-d031-4a3a-47b1-08dbdc82ac2a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 49HNORHSzX6NS3shbk8z/O3vqVfr4OGGsucLyHaBYxIFN0yDj5nHfiJL25DOsSux1tgOGrNmGIORfFnM6a0SJPTHpowXUGonmU65LL5K5rI6JKZbx27ONh1mU6E2533hyej0Kry852yLivnw8OE+jmP4HWKM47b2KioB4qd+9L1v3CPfi62GfGJrlJizSUe4IDOHQA/SIiHq5J8HmfDq9PuxhWfYhgDyUlxhPJ6bzp7WWkKSEePspnVUc1ld27LTXzwrM/u5beoFHlZEuy68gJMV4GLlltrE0orS5cs/PneyvM0SSLySvKiTwPWN+9nt0f3kd+H3saNQjwAAtmAh4FTIRrgpJjXHJOCacdA7B0FxQjBlyZdXCwgEyFXw7BUVz2RFZVJV4g82NEjtzj4546cw7fGa1NIfsEZkmyKEI9f4LcxK296eLCnOklmvg70ZE8hHvZgISgkiuY98a178VtYlKkn4AFDvDeBA6yL2jOhGfyP67UjNT/aHNaR4ZTt9T2j/4MIIG3jXqzUPCbI7jY01mWieA6ZwEZ++kEkxpoN0MWQHF+CKQ3yn/c5O9AzGl+K316XeWAf/imdbpTmOBYeVsI2bZhIFaZzH6ovXxJjgkJOzymp88xGcbPtDshKorO6AubLBL7FDNmNeBEbVZglSUsj4bfD3Vt4jeZHVw7Yva51lM+cfsZIbX8nph0bvHWxuXEN0bNLMrUZjZuuQel6nRR9aDz9USsw8mHWsIfrWV5xhVnAgQhMuc44acZsgwYTkuaEFRzS1RUGcvL603g== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230031)(4636009)(136003)(396003)(376002)(346002)(39860400002)(230922051799003)(64100799003)(451199024)(82310400011)(186009)(1800799009)(40470700004)(36840700001)(46966006)(8676002)(966005)(40460700003)(2906002)(478600001)(2616005)(26005)(426003)(336012)(82740400003)(86362001)(81166007)(83380400001)(47076005)(36756003)(36860700001)(40480700001)(7696005)(5660300002)(6916009)(316002)(70206006)(41300700001)(84970400001)(70586007)(44832011)(30864003)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2023 15:36:49.0069 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0313f8db-d678-4fe6-4cff-08dbdc82b1cf 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: DU6PEPF0000B622.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9362 X-Spam-Status: No, score=-11.5 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 Refactor the parsing to have a single API and fix a few parsing issues: - Different handling of "bti+none" and "none+bti": these should be rejected because "none" can only appear alone. - Accepted empty strings such as "bti++pac-ret" or "bti+", this bug was caused by using strtok_r. - Memory got leaked (str_root was never freed). And two buffers got allocated when one is enough. The callbacks now have no failure mode, only parsing can fail and all failures are handled locally. The "-mbranch-protection=" vs "target("branch-protection=")" difference in the error message is handled by a separate argument to aarch_validate_mbranch_protection. gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_override_options): Update. (aarch64_handle_attr_branch_protection): Update. * config/arm/aarch-common-protos.h (aarch_parse_branch_protection): Remove. (aarch_validate_mbranch_protection): Add new argument. * config/arm/aarch-common.cc (aarch_handle_no_branch_protection): Update. (aarch_handle_standard_branch_protection): Update. (aarch_handle_pac_ret_protection): Update. (aarch_handle_pac_ret_leaf): Update. (aarch_handle_pac_ret_b_key): Update. (aarch_handle_bti_protection): Update. (aarch_parse_branch_protection): Remove. (next_tok): New. (aarch_validate_mbranch_protection): Rewrite. * config/arm/aarch-common.h (struct aarch_branch_protect_type): Add field "alone". * config/arm/arm.cc (arm_configure_build_target): Update. gcc/testsuite/ChangeLog: * gcc.target/aarch64/branch-protection-attr.c: Update. * gcc.target/aarch64/branch-protection-option.c: Update. --- v2: merge tests updates into the patch error message is not changed, see previous discussion: https://gcc.gnu.org/pipermail/gcc-patches/2023-October/633945.html --- gcc/config/aarch64/aarch64.cc | 37 +-- gcc/config/arm/aarch-common-protos.h | 5 +- gcc/config/arm/aarch-common.cc | 214 ++++++++---------- gcc/config/arm/aarch-common.h | 14 +- gcc/config/arm/arm.cc | 3 +- .../aarch64/branch-protection-attr.c | 6 +- .../aarch64/branch-protection-option.c | 2 +- 7 files changed, 113 insertions(+), 168 deletions(-) diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index f8e8fefc8d8..4f7f707b675 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -18642,7 +18642,8 @@ aarch64_override_options (void) aarch64_validate_sls_mitigation (aarch64_harden_sls_string); if (aarch64_branch_protection_string) - aarch_validate_mbranch_protection (aarch64_branch_protection_string); + aarch_validate_mbranch_protection (aarch64_branch_protection_string, + "-mbranch-protection="); /* -mcpu=CPU is shorthand for -march=ARCH_FOR_CPU, -mtune=CPU. If either of -march or -mtune is given, they override their @@ -19016,34 +19017,12 @@ aarch64_handle_attr_cpu (const char *str) /* Handle the argument STR to the branch-protection= attribute. */ - static bool - aarch64_handle_attr_branch_protection (const char* str) - { - char *err_str = (char *) xmalloc (strlen (str) + 1); - enum aarch_parse_opt_result res = aarch_parse_branch_protection (str, - &err_str); - bool success = false; - switch (res) - { - case AARCH_PARSE_MISSING_ARG: - error ("missing argument to % pragma or" - " attribute"); - break; - case AARCH_PARSE_INVALID_ARG: - error ("invalid protection type %qs in % pragma or attribute", err_str); - break; - case AARCH_PARSE_OK: - success = true; - /* Fall through. */ - case AARCH_PARSE_INVALID_FEATURE: - break; - default: - gcc_unreachable (); - } - free (err_str); - return success; - } +static bool +aarch64_handle_attr_branch_protection (const char* str) +{ + return aarch_validate_mbranch_protection (str, + "target(\"branch-protection=\")"); +} /* Handle the argument STR to the tune= target attribute. */ diff --git a/gcc/config/arm/aarch-common-protos.h b/gcc/config/arm/aarch-common-protos.h index f8cb6562096..75ffdfbb050 100644 --- a/gcc/config/arm/aarch-common-protos.h +++ b/gcc/config/arm/aarch-common-protos.h @@ -159,10 +159,7 @@ rtx_insn *arm_md_asm_adjust (vec &outputs, vec & /*inputs*/, vec &clobbers, HARD_REG_SET &clobbered_regs, location_t loc); -/* Parsing routine for branch-protection common to AArch64 and Arm. */ -enum aarch_parse_opt_result aarch_parse_branch_protection (const char*, char**); - /* Validation routine for branch-protection common to AArch64 and Arm. */ -bool aarch_validate_mbranch_protection (const char *); +bool aarch_validate_mbranch_protection (const char *, const char *); #endif /* GCC_AARCH_COMMON_PROTOS_H */ diff --git a/gcc/config/arm/aarch-common.cc b/gcc/config/arm/aarch-common.cc index cbc7f68a8bf..159c61b786c 100644 --- a/gcc/config/arm/aarch-common.cc +++ b/gcc/config/arm/aarch-common.cc @@ -659,169 +659,143 @@ arm_md_asm_adjust (vec &outputs, vec & /*inputs*/, return saw_asm_flag ? seq : NULL; } -static enum aarch_parse_opt_result -aarch_handle_no_branch_protection (char* str, char* rest) +static void +aarch_handle_no_branch_protection (void) { aarch_ra_sign_scope = AARCH_FUNCTION_NONE; aarch_enable_bti = 0; - if (rest) - { - error ("unexpected %<%s%> after %<%s%>", rest, str); - return AARCH_PARSE_INVALID_FEATURE; - } - return AARCH_PARSE_OK; } -static enum aarch_parse_opt_result -aarch_handle_standard_branch_protection (char* str, char* rest) +static void +aarch_handle_standard_branch_protection (void) { aarch_ra_sign_scope = AARCH_FUNCTION_NON_LEAF; aarch_ra_sign_key = AARCH_KEY_A; aarch_enable_bti = 1; - if (rest) - { - error ("unexpected %<%s%> after %<%s%>", rest, str); - return AARCH_PARSE_INVALID_FEATURE; - } - return AARCH_PARSE_OK; } -static enum aarch_parse_opt_result -aarch_handle_pac_ret_protection (char* str ATTRIBUTE_UNUSED, - char* rest ATTRIBUTE_UNUSED) +static void +aarch_handle_pac_ret_protection (void) { aarch_ra_sign_scope = AARCH_FUNCTION_NON_LEAF; aarch_ra_sign_key = AARCH_KEY_A; - return AARCH_PARSE_OK; } -static enum aarch_parse_opt_result -aarch_handle_pac_ret_leaf (char* str ATTRIBUTE_UNUSED, - char* rest ATTRIBUTE_UNUSED) +static void +aarch_handle_pac_ret_leaf (void) { aarch_ra_sign_scope = AARCH_FUNCTION_ALL; - return AARCH_PARSE_OK; } -static enum aarch_parse_opt_result -aarch_handle_pac_ret_b_key (char* str ATTRIBUTE_UNUSED, - char* rest ATTRIBUTE_UNUSED) +static void +aarch_handle_pac_ret_b_key (void) { aarch_ra_sign_key = AARCH_KEY_B; - return AARCH_PARSE_OK; } -static enum aarch_parse_opt_result -aarch_handle_bti_protection (char* str ATTRIBUTE_UNUSED, - char* rest ATTRIBUTE_UNUSED) +static void +aarch_handle_bti_protection (void) { aarch_enable_bti = 1; - return AARCH_PARSE_OK; } static const struct aarch_branch_protect_type aarch_pac_ret_subtypes[] = { - { "leaf", aarch_handle_pac_ret_leaf, NULL, 0 }, - { "b-key", aarch_handle_pac_ret_b_key, NULL, 0 }, - { NULL, NULL, NULL, 0 } + { "leaf", false, aarch_handle_pac_ret_leaf, NULL, 0 }, + { "b-key", false, aarch_handle_pac_ret_b_key, NULL, 0 }, + { NULL, false, NULL, NULL, 0 } }; static const struct aarch_branch_protect_type aarch_branch_protect_types[] = { - { "none", aarch_handle_no_branch_protection, NULL, 0 }, - { "standard", aarch_handle_standard_branch_protection, NULL, 0 }, - { "pac-ret", aarch_handle_pac_ret_protection, aarch_pac_ret_subtypes, + { "none", true, aarch_handle_no_branch_protection, NULL, 0 }, + { "standard", true, aarch_handle_standard_branch_protection, NULL, 0 }, + { "pac-ret", false, aarch_handle_pac_ret_protection, aarch_pac_ret_subtypes, ARRAY_SIZE (aarch_pac_ret_subtypes) }, - { "bti", aarch_handle_bti_protection, NULL, 0 }, - { NULL, NULL, NULL, 0 } + { "bti", false, aarch_handle_bti_protection, NULL, 0 }, + { NULL, false, NULL, NULL, 0 } }; -/* Parses CONST_STR for branch protection features specified in - aarch64_branch_protect_types, and set any global variables required. Returns - the parsing result and assigns LAST_STR to the last processed token from - CONST_STR so that it can be used for error reporting. */ +/* In-place split *str at delim, return *str and set *str to the tail + of the string or NULL if the end is reached. */ -enum aarch_parse_opt_result -aarch_parse_branch_protection (const char *const_str, char** last_str) +static char * +next_tok (char **str, int delim) { - char *str_root = xstrdup (const_str); - char* token_save = NULL; - char *str = strtok_r (str_root, "+", &token_save); - enum aarch_parse_opt_result res = AARCH_PARSE_OK; - if (!str) - res = AARCH_PARSE_MISSING_ARG; - else + char *tok = *str; + for (char *p = tok; p && *p != '\0'; p++) { - char *next_str = strtok_r (NULL, "+", &token_save); - /* Reset the branch protection features to their defaults. */ - aarch_handle_no_branch_protection (NULL, NULL); - - while (str && res == AARCH_PARSE_OK) + if (*p == delim) { - const aarch_branch_protect_type* type = aarch_branch_protect_types; - bool found = false; - /* Search for this type. */ - while (type && type->name && !found && res == AARCH_PARSE_OK) - { - if (strcmp (str, type->name) == 0) - { - found = true; - res = type->handler (str, next_str); - str = next_str; - next_str = strtok_r (NULL, "+", &token_save); - } - else - type++; - } - if (found && res == AARCH_PARSE_OK) - { - bool found_subtype = true; - /* Loop through each token until we find one that isn't a - subtype. */ - while (found_subtype) - { - found_subtype = false; - const aarch_branch_protect_type *subtype = type->subtypes; - /* Search for the subtype. */ - while (str && subtype && subtype->name && !found_subtype - && res == AARCH_PARSE_OK) - { - if (strcmp (str, subtype->name) == 0) - { - found_subtype = true; - res = subtype->handler (str, next_str); - str = next_str; - next_str = strtok_r (NULL, "+", &token_save); - } - else - subtype++; - } - } - } - else if (!found) - res = AARCH_PARSE_INVALID_ARG; + *p = '\0'; + *str = p + 1; + return tok; } } - /* Copy the last processed token into the argument to pass it back. - Used by option and attribute validation to print the offending token. */ - if (last_str) - { - if (str) - strcpy (*last_str, str); - else - *last_str = NULL; - } - return res; + *str = NULL; + return tok; } +/* Parses CONST_STR for branch protection features specified in + aarch64_branch_protect_types, and set any global variables required. + Returns true on success. */ + bool -aarch_validate_mbranch_protection (const char *const_str) +aarch_validate_mbranch_protection (const char *const_str, const char *opt) { - char *str = (char *) xmalloc (strlen (const_str)); - enum aarch_parse_opt_result res = - aarch_parse_branch_protection (const_str, &str); - if (res == AARCH_PARSE_INVALID_ARG) - error ("invalid argument %<%s%> for %<-mbranch-protection=%>", str); - else if (res == AARCH_PARSE_MISSING_ARG) - error ("missing argument for %<-mbranch-protection=%>"); - free (str); - return res == AARCH_PARSE_OK; + char *str_root = xstrdup (const_str); + char *next_str = str_root; + char *str = next_tok (&next_str, '+'); + char *alone_str = NULL; + bool reject_alone = false; + bool res = true; + + /* First entry is "none" and it is used to reset the state. */ + aarch_branch_protect_types[0].handler (); + + while (str) + { + const aarch_branch_protect_type *type = aarch_branch_protect_types; + for (; type->name; type++) + if (strcmp (str, type->name) == 0) + break; + if (type->name == NULL) + { + res = false; + error ("invalid argument %<%s%> for %<%s%>", str, opt); + break; + } + + if (type->alone && alone_str == NULL) + alone_str = str; + else + reject_alone = true; + if (reject_alone && alone_str != NULL) + { + res = false; + error ("argument %<%s%> can only appear alone in %<%s%>", + alone_str, opt); + break; + } + + type->handler (); + str = next_tok (&next_str, '+'); + if (type->subtypes == NULL) + continue; + + /* Loop through tokens until we find one that isn't a subtype. */ + while (str) + { + const aarch_branch_protect_type *subtype = type->subtypes; + for (; subtype->name; subtype++) + if (strcmp (str, subtype->name) == 0) + break; + if (subtype->name == NULL) + break; + + subtype->handler (); + str = next_tok (&next_str, '+'); + } + } + + free (str_root); + return res; } diff --git a/gcc/config/arm/aarch-common.h b/gcc/config/arm/aarch-common.h index c6a67f0d05c..f72e21127fc 100644 --- a/gcc/config/arm/aarch-common.h +++ b/gcc/config/arm/aarch-common.h @@ -55,16 +55,10 @@ struct aarch_branch_protect_type /* The type's name that the user passes to the branch-protection option string. */ const char* name; - /* Function to handle the protection type and set global variables. - First argument is the string token corresponding with this type and the - second argument is the next token in the option string. - Return values: - * AARCH_PARSE_OK: Handling was sucessful. - * AARCH_INVALID_ARG: The type is invalid in this context and the caller - should print an error. - * AARCH_INVALID_FEATURE: The type is invalid and the handler prints its - own error. */ - enum aarch_parse_opt_result (*handler)(char*, char*); + /* The type can only appear alone, other types should be rejected. */ + int alone; + /* Function to handle the protection type and set global variables. */ + void (*handler)(void); /* A list of types that can follow this type in the option string. */ const struct aarch_branch_protect_type* subtypes; unsigned int num_subtypes; diff --git a/gcc/config/arm/arm.cc b/gcc/config/arm/arm.cc index f49312cace0..5681073a948 100644 --- a/gcc/config/arm/arm.cc +++ b/gcc/config/arm/arm.cc @@ -3297,7 +3297,8 @@ arm_configure_build_target (struct arm_build_target *target, if (opts->x_arm_branch_protection_string) { - aarch_validate_mbranch_protection (opts->x_arm_branch_protection_string); + aarch_validate_mbranch_protection (opts->x_arm_branch_protection_string, + "-mbranch-protection="); if (aarch_ra_sign_key != AARCH_KEY_A) { diff --git a/gcc/testsuite/gcc.target/aarch64/branch-protection-attr.c b/gcc/testsuite/gcc.target/aarch64/branch-protection-attr.c index 272000c2747..dae2a758a56 100644 --- a/gcc/testsuite/gcc.target/aarch64/branch-protection-attr.c +++ b/gcc/testsuite/gcc.target/aarch64/branch-protection-attr.c @@ -4,19 +4,19 @@ void __attribute__ ((target("branch-protection=leaf"))) foo1 () { } -/* { dg-error {invalid protection type 'leaf' in 'target\("branch-protection="\)' pragma or attribute} "" { target *-*-* } 5 } */ +/* { dg-error {invalid argument 'leaf' for 'target\("branch-protection="\)'} "" { target *-*-* } 5 } */ /* { dg-error {pragma or attribute 'target\("branch-protection=leaf"\)' is not valid} "" { target *-*-* } 5 } */ void __attribute__ ((target("branch-protection=none+pac-ret"))) foo2 () { } -/* { dg-error "unexpected 'pac-ret' after 'none'" "" { target *-*-* } 12 } */ +/* { dg-error {argument 'none' can only appear alone in 'target\("branch-protection="\)'} "" { target *-*-* } 12 } */ /* { dg-error {pragma or attribute 'target\("branch-protection=none\+pac-ret"\)' is not valid} "" { target *-*-* } 12 } */ void __attribute__ ((target("branch-protection="))) foo3 () { } -/* { dg-error {missing argument to 'target\("branch-protection="\)' pragma or attribute} "" { target *-*-* } 19 } */ +/* { dg-error {invalid argument '' for 'target\("branch-protection="\)'} "" { target *-*-* } 19 } */ /* { dg-error {pragma or attribute 'target\("branch-protection="\)' is not valid} "" { target *-*-* } 19 } */ diff --git a/gcc/testsuite/gcc.target/aarch64/branch-protection-option.c b/gcc/testsuite/gcc.target/aarch64/branch-protection-option.c index 1b3bf4ee2b8..e2f847a31c4 100644 --- a/gcc/testsuite/gcc.target/aarch64/branch-protection-option.c +++ b/gcc/testsuite/gcc.target/aarch64/branch-protection-option.c @@ -1,4 +1,4 @@ /* { dg-do "compile" } */ /* { dg-options "-mbranch-protection=leaf -mbranch-protection=none+pac-ret" } */ -/* { dg-error "unexpected 'pac-ret' after 'none'" "" { target *-*-* } 0 } */ +/* { dg-error "argument 'none' can only appear alone in '-mbranch-protection='" "" { target *-*-* } 0 } */ From patchwork Fri Nov 3 15:36:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 1858961 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=lDR0t+gy; 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=lDR0t+gy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SMPz60hJbz1yQ4 for ; Sat, 4 Nov 2023 02:38:26 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 946013861866 for ; Fri, 3 Nov 2023 15:38:19 +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-am6eur05on2048.outbound.protection.outlook.com [40.107.22.48]) by sourceware.org (Postfix) with ESMTPS id 665BF385800C for ; Fri, 3 Nov 2023 15:36:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 665BF385800C 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 665BF385800C Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.22.48 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699025829; cv=pass; b=pgF7LmPV+otwB5WJpd0PeyIwHkBCeNZWPr4bSdZr/F7lRjBXlMnqPvGqWjLxnJHu8ujf34TO60cPkurW6A4v89q+zjKqLSr9JObAZXHkj86BZvI1ox9uY/qVUZ7XnzmKrk8xCIflZM85oD/IcBHLOhmrCbXTw+zZpJWyKqwZYis= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699025829; c=relaxed/simple; bh=H6GG5UAPRj4Pzg3JtbMBwQERdaKGsiKzFVG/JyEKfKc=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=rGKQZmdsaKh5GdefcbcW+UkEDZMYxIXBEWuohuFJIGuyVqCbkVmu4uNyzw313lw515DMhlDHyMBOw4B7/TjY85EOJUZgdh3Ul0kWqwE2HaXj6Rliedi8TFxezEIJds9NblxqzkxlC5Qpe7O/a8Qn2eYgjbtYRak9iYNQ4iWsbag= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=gIybvduzF//dr7skJC594oj52RLfOdYQ+TUhs2C7R40x4LLVEePg0rvR1G46JS3MnqMdsBoOUintjxK26/UayWtDq5hBXjmz9o0kuFVv8ApqCmG6Tcf6ghlNWSklulaqzlE7mTI5G2qVk8DeM91z+MeHgRrOQwggcR3iEGR74hVTAgl56t2I6CR0FaeGMchjvCwtAbF7wXrpvAaw44HCanDcDcFRebBG2JKKLZC9CEmvw6CUbGQKIlz0L04gsFNPFkAO6Btd0Ivan2gq+OhRS+rtUfT7gfJU+NagA1nqzfVNLlil0ASDzCeClO0t16vkDQKcU5pah+WARYc1PJ25dg== 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=bqogBncRfrMzAcz9ZulWvlOfOllUL/15mP+N9E0s3n0=; b=W2lGB+lPGNcO4Ptp8C0fQiZLki10TovRsnWzWZ4RNoHEQ49V+uaeYLPZgTdLKR6kqmQKXXKcy1bZ7QSkLfqeBdPfcc31onoz9+CuvDFgFQMNHAIJb819ySG8sEpSap/JnIIu1jmV6/LQ41zas8KRRbvFlrMUrDLz1qa+rcZe0HZj8ynL+uSZaYBfODn88G+Zua1ujK4eYbbtyT9feeIIakHI5mxXV+gbEB5sdxmc6AxGFGb9IteoLW1kW51ZFOWHWB8t7NRMHYpCma/KFYxgq7Nz424Ng/YPK6AQOo7F243QK/rNm7YkdzhVO/B2q/VT8cuWiealWX8h/eKZhd5M3w== 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=bqogBncRfrMzAcz9ZulWvlOfOllUL/15mP+N9E0s3n0=; b=lDR0t+gyycIenhfV/1nLp/rtAn+TrUFFvFC2qzczIBaYZKsdZaewAnbPzWK8XVew7WWNifUZwl20JUuOY7EnHTuui6DhAsH7rKdihtYW9vTKlH38asc1uE1T6SgKu/K5EpsqbfSa7tf3ZKLHSbG6PTJXcvE81NCN19+yAkfHWA0= Received: from AM0PR04CA0103.eurprd04.prod.outlook.com (2603:10a6:208:be::44) by AS8PR08MB6342.eurprd08.prod.outlook.com (2603:10a6:20b:31a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21; Fri, 3 Nov 2023 15:36:56 +0000 Received: from AM4PEPF00027A5E.eurprd04.prod.outlook.com (2603:10a6:208:be:cafe::5c) by AM0PR04CA0103.outlook.office365.com (2603:10a6:208:be::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.22 via Frontend Transport; Fri, 3 Nov 2023 15:36:56 +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 AM4PEPF00027A5E.mail.protection.outlook.com (10.167.16.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19 via Frontend Transport; Fri, 3 Nov 2023 15:36:54 +0000 Received: ("Tessian outbound 385ad2f98d71:v228"); Fri, 03 Nov 2023 15:36:54 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 22fccc3ed253a6ea X-CR-MTA-TID: 64aa7808 Received: from 204c7d7c6993.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8813F775-880C-48B1-A4C3-0AB9F493B316.1; Fri, 03 Nov 2023 15:36:47 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 204c7d7c6993.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 03 Nov 2023 15:36:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XUPSQ3J/IfCLrNFGi09oCnCpvaBJngCwBRTDtgkUy3bEvim09i3TCFxuNnhcbHxYuUFEtzz5etB+Vg7k2/ZbVMnxl5rP8YwV5K7/7ZPspIXxQmPFzUZkIrZp+qX0KTuHPAwJtp9pKfzB23uXnpqVm2RagpN+yRe7N5nAiLlAaJLrtdP50aYgMos4yMCX0oDYtIr3BJunlgQb0BdWsviaZ3By11WHe0kr5Xixi8e3vff3aKrQqtbk00NPUKl+N4dn93UEotQ6YHXIjWHh+qe0KdyGJiip0XDDDMDmE80o62AXry6v3RXrWu8DCJJ9pRTmzPty44Tv0pAeYjv1qioJgQ== 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=bqogBncRfrMzAcz9ZulWvlOfOllUL/15mP+N9E0s3n0=; b=LAEgUwA4pHleBybvegyISaCcp1ptJYteAv5SBX8dwAPYR+XzJshhs/bgk34CJAKJoLexosDZIEti2tb/d9yjsB6IA5sgWtIuLHEfqR+xK97l7dNox101o6duVA3uIXGipfA8bDF5r8sDIzhMBlX2gOloD/iOUnAXVhp0idOnNERCvue8nM2YUhVPYxUgxsZjYUN9i+rZ56OmgXcjwRLSqfNVdeTg7tluxLcp1sXydJP/Vsy0LebHSjmDSsp02j/f0K7sx/XJ1UuU0D7WSWGVNENSccqlZHTsDPG9TJgs8bk9I/fPr+3lU3ntYCxfJdG67HZKLf8M8iZ4vqzteputrA== 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=bqogBncRfrMzAcz9ZulWvlOfOllUL/15mP+N9E0s3n0=; b=lDR0t+gyycIenhfV/1nLp/rtAn+TrUFFvFC2qzczIBaYZKsdZaewAnbPzWK8XVew7WWNifUZwl20JUuOY7EnHTuui6DhAsH7rKdihtYW9vTKlH38asc1uE1T6SgKu/K5EpsqbfSa7tf3ZKLHSbG6PTJXcvE81NCN19+yAkfHWA0= Received: from AS9P251CA0024.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:50f::26) by DU0PR08MB10326.eurprd08.prod.outlook.com (2603:10a6:10:472::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21; Fri, 3 Nov 2023 15:36:45 +0000 Received: from AMS0EPF000001B2.eurprd05.prod.outlook.com (2603:10a6:20b:50f:cafe::c2) by AS9P251CA0024.outlook.office365.com (2603:10a6:20b:50f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.22 via Frontend Transport; Fri, 3 Nov 2023 15:36:45 +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 AMS0EPF000001B2.mail.protection.outlook.com (10.167.16.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6954.19 via Frontend Transport; Fri, 3 Nov 2023 15:36:45 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) 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; Fri, 3 Nov 2023 15:36:45 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Fri, 3 Nov 2023 15:36:44 +0000 Received: from armchair.cambridge.arm.com (10.2.80.71) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Fri, 3 Nov 2023 15:36:44 +0000 From: Szabolcs Nagy To: Subject: [PATCH v2 7/7] aarch64,arm: Move branch-protection data to targets Date: Fri, 3 Nov 2023 15:36:44 +0000 Message-ID: <69a6baa924519053eef92766189d23da1f7afa7c.1699025215.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS0EPF000001B2:EE_|DU0PR08MB10326:EE_|AM4PEPF00027A5E:EE_|AS8PR08MB6342:EE_ X-MS-Office365-Filtering-Correlation-Id: ba5bedc1-d1e5-46ba-5f3f-08dbdc82b512 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: PygsorNZLxiHZkHXl064FMFwynWQLIFmlDO92VE8KFhsUs9o5Lt0Kz/ZOHOV7OrUgvN7KJZBqHvWu9mbk5ohsnjVPsq1cr+EPco7ok0rAE85beOfxG7btJVJbQbe9saTcXq7eHX5hy1Vsx3aHOFYe8I2gfOCbXDy3Bvu5VsH6fw43TA0HawCbJDOZ/x4HiGBd+9cKYslhTGxpz6sFoxGtLLZITHgyxLOAdczSFkXChy8lKyt88DE6m5rI+zp4DEWVJ5e5NiP0U9APG7qvzE8LjGKV/0Dovt20Nw93Opok2hfxXV9Ucj10ZRFIecL2IisuHWmdwbPmdMd7qmIffYI+xmoJalS13TkTN3sWum5let17UUMZW5a/yKa+0IBEtTIapQ21GkQpWBhHfR3dNmfnUlJxBsWU5aHt+ZhlQvraDscH2mFcSx6o55iCrMhrcpP2Hvo8An/30ETGNjbUd1P/gPFhuJaD/YGTb+V3aErMLn1w6EQLFhk3drjiDfF1PmqEXh2qk9xrrquIrYoqJinHrqq0VWCMVpK6BJdtVxameoq4HZYj3xYsvhzZtPmK7IO43qhu9JjjmvwEzuomIoNEJCWLavCTgCb4B1UavCd4iNUKMmRvmjb2c0QSgWvCp7O46CQP3oXAgqQtJUGO2AGIyLDuQlLevkcG5GWfba/Wr8kxI8OGsLZSBnNgrF2n06YFXOXJEvJahWJmz7CLpA+QdqIspOWtjvLhfa/BdVDOHnIUbvCmqSGuTahoc2gUml7zh8yVPbPVw9vysOHmIJasg5J4ZNd2V4MTRMjSKHtTGmx9GpfG2WYH1acxsbxmOc/ 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)(396003)(136003)(376002)(39860400002)(346002)(230922051799003)(230273577357003)(230173577357003)(451199024)(64100799003)(186009)(1800799009)(82310400011)(36840700001)(40470700004)(46966006)(44832011)(40460700003)(6916009)(8676002)(316002)(8936002)(70586007)(70206006)(86362001)(478600001)(36756003)(41300700001)(36860700001)(2906002)(82740400003)(5660300002)(47076005)(81166007)(356005)(336012)(2616005)(26005)(426003)(7696005)(83380400001)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB10326 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00027A5E.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: ea73464c-a8a9-4217-2cac-08dbdc82afed X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OVOFZmijk0nATPluimk5OoPYTJpDaC4Q82wKGy4MmXNhQsIv4ofEtoGdp7EBKdS+3/A+lHk9Uj+DmfW8SrvezeJXQvrMUSBLBq3PMJfc8Sj2NTPJ/kqyEzJ09lmy98joh0XyG6NdAUSNl9v5mmoyMRJxQhRcIE21lyulJG62Easq/klb7Pue/PPtVFQJBhhSF+zk+JLP4oDqX8vSkJTY4p2ja2u18omomULnfXsroabtZ5SVUvQdYbcSV1uSK/bRwxSj///hnUjDHcw5ou8oLaNypBlcL+u7/fILQrgBO1h99hFW3TNgZIhm0DpBybrnb6qw7NheXBJC1Hn9e6YLEssgE6OfpTk5uXuaD33OnxKiyM3O4ZAtzgmK5LKDtQ5uGE2WqZwjBbMN1+Ipm0T458uRIkcP3iP/byHlEzI2ZHI8r0gq0ar1cdwNaCzOpOi2h+VEW40Dn7M7lRrZHCFT9D0lKy80U0ZutQqyEMcEMTRCjSjCQsgrjNR1oT0DhZsqhs304VGhtEgKsAhc+vXTddVoDmyFLdFHsgx3vdMzcPmdOImO3RkpJBU3/NTPd+hdLuW5wJ5i2geFZkQucSD1BllRjYZBA7m9fO2aGM8aWgZyApkrwixpllPNNqW0Wm32hLywLPs9Xe4dZHINQN+ntxlM8mqyM5QeI4rq4hHBI378ZOPtekAVzn/DS8E1nJ0Sbc2uuminnUd41Dy/+aujMExOalRXLvzSWWh5CwHfxe4idBzLWFfi6tjXxrWQIda+1Zx2VORVwHuq2jjdbZ7slqdUtlDBabiZDkp0EUzKvm8= 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)(346002)(136003)(376002)(39860400002)(396003)(230922051799003)(230273577357003)(230173577357003)(186009)(82310400011)(64100799003)(451199024)(1800799009)(46966006)(36840700001)(40470700004)(2906002)(40460700003)(36860700001)(36756003)(7696005)(41300700001)(86362001)(336012)(426003)(2616005)(26005)(81166007)(83380400001)(47076005)(82740400003)(478600001)(70586007)(70206006)(8936002)(6916009)(316002)(44832011)(40480700001)(5660300002)(8676002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2023 15:36:54.4171 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ba5bedc1-d1e5-46ba-5f3f-08dbdc82b512 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: AM4PEPF00027A5E.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6342 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org The branch-protection types are target specific, not the same on arm and aarch64. This currently affects pac-ret+b-key, but there will be a new type on aarch64 that is not relevant for arm. gcc/ChangeLog: * config/aarch64/aarch64-opts.h (enum aarch64_key_type): Rename to ... (enum aarch_key_type): ... this. * config/aarch64/aarch64.cc (aarch_handle_no_branch_protection): Copy. (aarch_handle_standard_branch_protection): Copy. (aarch_handle_pac_ret_protection): Copy. (aarch_handle_pac_ret_leaf): Copy. (aarch_handle_pac_ret_b_key): Copy. (aarch_handle_bti_protection): Copy. * config/arm/aarch-common.cc (aarch_handle_no_branch_protection): Remove. (aarch_handle_standard_branch_protection): Remove. (aarch_handle_pac_ret_protection): Remove. (aarch_handle_pac_ret_leaf): Remove. (aarch_handle_pac_ret_b_key): Remove. (aarch_handle_bti_protection): Remove. * config/arm/aarch-common.h (enum aarch_key_type): Remove. (struct aarch_branch_protect_type): Declare. * config/arm/arm-c.cc (arm_cpu_builtins): Remove aarch_ra_sign_key. * config/arm/arm.cc (aarch_handle_no_branch_protection): Copy. (aarch_handle_standard_branch_protection): Copy. (aarch_handle_pac_ret_protection): Copy. (aarch_handle_pac_ret_leaf): Copy. (aarch_handle_bti_protection): Copy. (arm_configure_build_target): Copy. * config/arm/arm.opt: Remove aarch_ra_sign_key. --- unchanged compared to v1. --- gcc/config/aarch64/aarch64-opts.h | 6 ++-- gcc/config/aarch64/aarch64.cc | 55 +++++++++++++++++++++++++++++++ gcc/config/arm/aarch-common.cc | 55 ------------------------------- gcc/config/arm/aarch-common.h | 11 +++---- gcc/config/arm/arm-c.cc | 2 -- gcc/config/arm/arm.cc | 52 +++++++++++++++++++++++++---- gcc/config/arm/arm.opt | 3 -- 7 files changed, 109 insertions(+), 75 deletions(-) diff --git a/gcc/config/aarch64/aarch64-opts.h b/gcc/config/aarch64/aarch64-opts.h index 831e28ab52a..1abae1442b5 100644 --- a/gcc/config/aarch64/aarch64-opts.h +++ b/gcc/config/aarch64/aarch64-opts.h @@ -103,9 +103,9 @@ enum stack_protector_guard { }; /* The key type that -msign-return-address should use. */ -enum aarch64_key_type { - AARCH64_KEY_A, - AARCH64_KEY_B +enum aarch_key_type { + AARCH_KEY_A, + AARCH_KEY_B }; /* An enum specifying how to handle load and store pairs using diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index 4f7f707b675..9739223831f 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -18620,6 +18620,61 @@ aarch64_set_asm_isa_flags (aarch64_feature_flags flags) aarch64_set_asm_isa_flags (&global_options, flags); } +static void +aarch_handle_no_branch_protection (void) +{ + aarch_ra_sign_scope = AARCH_FUNCTION_NONE; + aarch_enable_bti = 0; +} + +static void +aarch_handle_standard_branch_protection (void) +{ + aarch_ra_sign_scope = AARCH_FUNCTION_NON_LEAF; + aarch_ra_sign_key = AARCH_KEY_A; + aarch_enable_bti = 1; +} + +static void +aarch_handle_pac_ret_protection (void) +{ + aarch_ra_sign_scope = AARCH_FUNCTION_NON_LEAF; + aarch_ra_sign_key = AARCH_KEY_A; +} + +static void +aarch_handle_pac_ret_leaf (void) +{ + aarch_ra_sign_scope = AARCH_FUNCTION_ALL; +} + +static void +aarch_handle_pac_ret_b_key (void) +{ + aarch_ra_sign_key = AARCH_KEY_B; +} + +static void +aarch_handle_bti_protection (void) +{ + aarch_enable_bti = 1; +} + +static const struct aarch_branch_protect_type aarch_pac_ret_subtypes[] = { + { "leaf", false, aarch_handle_pac_ret_leaf, NULL, 0 }, + { "b-key", false, aarch_handle_pac_ret_b_key, NULL, 0 }, + { NULL, false, NULL, NULL, 0 } +}; + +const struct aarch_branch_protect_type aarch_branch_protect_types[] = { + { "none", true, aarch_handle_no_branch_protection, NULL, 0 }, + { "standard", true, aarch_handle_standard_branch_protection, NULL, 0 }, + { "pac-ret", false, aarch_handle_pac_ret_protection, aarch_pac_ret_subtypes, + ARRAY_SIZE (aarch_pac_ret_subtypes) }, + { "bti", false, aarch_handle_bti_protection, NULL, 0 }, + { NULL, false, NULL, NULL, 0 } +}; + /* Implement TARGET_OPTION_OVERRIDE. This is called once in the beginning and is used to parse the -m{cpu,tune,arch} strings and setup the initial tuning structs. In particular it must set selected_tune and diff --git a/gcc/config/arm/aarch-common.cc b/gcc/config/arm/aarch-common.cc index 159c61b786c..92e1248f83f 100644 --- a/gcc/config/arm/aarch-common.cc +++ b/gcc/config/arm/aarch-common.cc @@ -659,61 +659,6 @@ arm_md_asm_adjust (vec &outputs, vec & /*inputs*/, return saw_asm_flag ? seq : NULL; } -static void -aarch_handle_no_branch_protection (void) -{ - aarch_ra_sign_scope = AARCH_FUNCTION_NONE; - aarch_enable_bti = 0; -} - -static void -aarch_handle_standard_branch_protection (void) -{ - aarch_ra_sign_scope = AARCH_FUNCTION_NON_LEAF; - aarch_ra_sign_key = AARCH_KEY_A; - aarch_enable_bti = 1; -} - -static void -aarch_handle_pac_ret_protection (void) -{ - aarch_ra_sign_scope = AARCH_FUNCTION_NON_LEAF; - aarch_ra_sign_key = AARCH_KEY_A; -} - -static void -aarch_handle_pac_ret_leaf (void) -{ - aarch_ra_sign_scope = AARCH_FUNCTION_ALL; -} - -static void -aarch_handle_pac_ret_b_key (void) -{ - aarch_ra_sign_key = AARCH_KEY_B; -} - -static void -aarch_handle_bti_protection (void) -{ - aarch_enable_bti = 1; -} - -static const struct aarch_branch_protect_type aarch_pac_ret_subtypes[] = { - { "leaf", false, aarch_handle_pac_ret_leaf, NULL, 0 }, - { "b-key", false, aarch_handle_pac_ret_b_key, NULL, 0 }, - { NULL, false, NULL, NULL, 0 } -}; - -static const struct aarch_branch_protect_type aarch_branch_protect_types[] = { - { "none", true, aarch_handle_no_branch_protection, NULL, 0 }, - { "standard", true, aarch_handle_standard_branch_protection, NULL, 0 }, - { "pac-ret", false, aarch_handle_pac_ret_protection, aarch_pac_ret_subtypes, - ARRAY_SIZE (aarch_pac_ret_subtypes) }, - { "bti", false, aarch_handle_bti_protection, NULL, 0 }, - { NULL, false, NULL, NULL, 0 } -}; - /* In-place split *str at delim, return *str and set *str to the tail of the string or NULL if the end is reached. */ diff --git a/gcc/config/arm/aarch-common.h b/gcc/config/arm/aarch-common.h index f72e21127fc..90d2112408f 100644 --- a/gcc/config/arm/aarch-common.h +++ b/gcc/config/arm/aarch-common.h @@ -44,12 +44,7 @@ enum aarch_function_type { AARCH_FUNCTION_ALL }; -/* The key type that -msign-return-address should use. */ -enum aarch_key_type { - AARCH_KEY_A, - AARCH_KEY_B -}; - +/* Specifies a -mbranch-protection= argument. */ struct aarch_branch_protect_type { /* The type's name that the user passes to the branch-protection option @@ -64,4 +59,8 @@ struct aarch_branch_protect_type unsigned int num_subtypes; }; +/* Target specific data and callbacks for parsing -mbranch-protection=. + The first item is used to reset the branch-protection settings. */ +extern const struct aarch_branch_protect_type aarch_branch_protect_types[]; + #endif /* GCC_AARCH_COMMON_H */ diff --git a/gcc/config/arm/arm-c.cc b/gcc/config/arm/arm-c.cc index d3d93ceba00..204403b3ff4 100644 --- a/gcc/config/arm/arm-c.cc +++ b/gcc/config/arm/arm-c.cc @@ -248,8 +248,6 @@ arm_cpu_builtins (struct cpp_reader* pfile) { unsigned int pac = 1; - gcc_assert (aarch_ra_sign_key == AARCH_KEY_A); - if (aarch_ra_sign_scope == AARCH_FUNCTION_ALL) pac |= 0x4; diff --git a/gcc/config/arm/arm.cc b/gcc/config/arm/arm.cc index 5681073a948..5cb0f2858b7 100644 --- a/gcc/config/arm/arm.cc +++ b/gcc/config/arm/arm.cc @@ -3250,6 +3250,52 @@ static sbitmap isa_all_fpubits_internal; static sbitmap isa_all_fpbits; static sbitmap isa_quirkbits; +static void +aarch_handle_no_branch_protection (void) +{ + aarch_ra_sign_scope = AARCH_FUNCTION_NONE; + aarch_enable_bti = 0; +} + +static void +aarch_handle_standard_branch_protection (void) +{ + aarch_ra_sign_scope = AARCH_FUNCTION_NON_LEAF; + aarch_enable_bti = 1; +} + +static void +aarch_handle_pac_ret_protection (void) +{ + aarch_ra_sign_scope = AARCH_FUNCTION_NON_LEAF; +} + +static void +aarch_handle_pac_ret_leaf (void) +{ + aarch_ra_sign_scope = AARCH_FUNCTION_ALL; +} + +static void +aarch_handle_bti_protection (void) +{ + aarch_enable_bti = 1; +} + +static const struct aarch_branch_protect_type aarch_pac_ret_subtypes[] = { + { "leaf", false, aarch_handle_pac_ret_leaf, NULL, 0 }, + { NULL, false, NULL, NULL, 0 } +}; + +const struct aarch_branch_protect_type aarch_branch_protect_types[] = { + { "none", true, aarch_handle_no_branch_protection, NULL, 0 }, + { "standard", true, aarch_handle_standard_branch_protection, NULL, 0 }, + { "pac-ret", false, aarch_handle_pac_ret_protection, aarch_pac_ret_subtypes, + ARRAY_SIZE (aarch_pac_ret_subtypes) }, + { "bti", false, aarch_handle_bti_protection, NULL, 0 }, + { NULL, false, NULL, NULL, 0 } +}; + /* Configure a build target TARGET from the user-specified options OPTS and OPTS_SET. If WARN_COMPATIBLE, emit a diagnostic if both the CPU and architecture have been specified, but the two are not identical. */ @@ -3299,12 +3345,6 @@ arm_configure_build_target (struct arm_build_target *target, { aarch_validate_mbranch_protection (opts->x_arm_branch_protection_string, "-mbranch-protection="); - - if (aarch_ra_sign_key != AARCH_KEY_A) - { - warning (0, "invalid key type for %<-mbranch-protection=%>"); - aarch_ra_sign_key = AARCH_KEY_A; - } } if (arm_selected_arch) diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt index 88299dabc3a..bd8bb00d035 100644 --- a/gcc/config/arm/arm.opt +++ b/gcc/config/arm/arm.opt @@ -30,9 +30,6 @@ enum aarch_function_type aarch_ra_sign_scope = AARCH_FUNCTION_NONE TargetVariable unsigned aarch_enable_bti = 0 -TargetVariable -enum aarch_key_type aarch_ra_sign_key = AARCH_KEY_A - Enum Name(tls_type) Type(enum arm_tls_type) TLS dialect to use: