From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2089.outbound.protection.outlook.com [40.107.6.89]) by sourceware.org (Postfix) with ESMTPS id 065D0385840D for ; Wed, 11 Jan 2023 09:55:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 065D0385840D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=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=3QajeBI2gZwuMIv5OL+dmdmZM9PH2Uy0MxoReTxNL6s=; b=lxk6dGQqblDAMqbUVFUEygNiTEs01U1sGQXxt4j2Zud0WNAsBfk7/fgzsVAUzLREZIcmhdJPRkrE4CFn+ju19AoTWewPfO42kpLX6b0jb9jpzdmK/5bKrhlgW7/VyljJM3DuNbStDs/efLHLOYxye8vXFD6KoA+KucxnDv9FcZQ= Received: from FR0P281CA0045.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:48::14) by DBBPR08MB5946.eurprd08.prod.outlook.com (2603:10a6:10:1f6::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Wed, 11 Jan 2023 09:55:47 +0000 Received: from VI1EUR03FT065.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:48:cafe::bb) by FR0P281CA0045.outlook.office365.com (2603:10a6:d10:48::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.12 via Frontend Transport; Wed, 11 Jan 2023 09:55:46 +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 VI1EUR03FT065.mail.protection.outlook.com (100.127.144.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Wed, 11 Jan 2023 09:55:46 +0000 Received: ("Tessian outbound 333ca28169fa:v132"); Wed, 11 Jan 2023 09:55:46 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 57aa8bb80e013264 X-CR-MTA-TID: 64aa7808 Received: from a55422591648.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8FF2602F-3317-4FA7-BDC9-C2DA3FA99C35.1; Wed, 11 Jan 2023 09:55:39 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a55422591648.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Jan 2023 09:55:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OB7Po8AQ8T6VTD165dXhHBVeD/WM0TNDuEyBASyUseVEV0CT2xxxW9eUB/aSJ9IfqtKjims2vay19F93f+ptlDoB7qi3lEqSmn/T2zuHhhkYvXHXX4SIY1nkT4fUZq6aXJKJWmqJWYMQ0+B44gkB9CnRejT88huPE3nmbY/DOA4NMXEV/pLZoad3RoZtA/4MVk5C8nihsUtoXRBrj30OU9nGcWdR1Z83P4xoLjnEqlQRnTrCnVZ+Zg248ADrQkN+Dr3sh6OWTKP92vvz9qq8vYWFr2oR97kwnalR0kBrTIkVfQLt2Bjx0mt8FSv5or7i3QU5rWzPdKNt3cEjqsXLyA== 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=3QajeBI2gZwuMIv5OL+dmdmZM9PH2Uy0MxoReTxNL6s=; b=VKu6X9XhfgHyglib+Tm42LG3cwMEx4PY47l3K6mO1/fq1ZwEN7o4tAhWC99TcX3hb0Yo1C6PdVQYLnCVikWhCnHvVNrnD9pvau2UivKRn5oQ5Ug8XglnN8lFr0pWqwin11KC01O6hDF2vYmdfCtmixyhKzyCjc6u1IPB/K9lM9NZ5YznOXklTqIlepdLV9ftF9jnXoSrtcZAYN7Nvdg9OtXsRZ15ZdH2cD87uemdvAmjJfYLQVX/a/ufaoX1GaXvX+9Zo4QdRJPzcaLXCe22GWjUjl+Pywkj9Cts52gy71Y47UVC3nwbuP7QZthKT/wTe8ERZB/AvpKGVkiGzBHudQ== 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 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=3QajeBI2gZwuMIv5OL+dmdmZM9PH2Uy0MxoReTxNL6s=; b=lxk6dGQqblDAMqbUVFUEygNiTEs01U1sGQXxt4j2Zud0WNAsBfk7/fgzsVAUzLREZIcmhdJPRkrE4CFn+ju19AoTWewPfO42kpLX6b0jb9jpzdmK/5bKrhlgW7/VyljJM3DuNbStDs/efLHLOYxye8vXFD6KoA+KucxnDv9FcZQ= Received: from AM5PR0201CA0014.eurprd02.prod.outlook.com (2603:10a6:203:3d::24) by PAVPR08MB9746.eurprd08.prod.outlook.com (2603:10a6:102:31d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Wed, 11 Jan 2023 09:55:37 +0000 Received: from AM7EUR03FT046.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:3d:cafe::e6) by AM5PR0201CA0014.outlook.office365.com (2603:10a6:203:3d::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13 via Frontend Transport; Wed, 11 Jan 2023 09:55:37 +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 AM7EUR03FT046.mail.protection.outlook.com (100.127.140.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.12 via Frontend Transport; Wed, 11 Jan 2023 09:55:36 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) 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.16; Wed, 11 Jan 2023 09:55:35 +0000 Received: from e124257 (10.34.105.24) by mail.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.16 via Frontend Transport; Wed, 11 Jan 2023 09:55:35 +0000 From: Andrea Corallo To: Richard Earnshaw CC: Andrea Corallo via Gcc-patches , nd , Richard Earnshaw Subject: Re: [PATCH 9/15] arm: Set again stack pointer as CFA reg when popping if necessary References: <280ceb21-4ea7-33ae-0d87-c3f01db33a9e@foss.arm.com> <35e22f98-8c00-e591-112c-64cc6612a7ad@foss.arm.com> Date: Wed, 11 Jan 2023 10:55:34 +0100 In-Reply-To: <35e22f98-8c00-e591-112c-64cc6612a7ad@foss.arm.com> (Richard Earnshaw's message of "Mon, 9 Jan 2023 17:22:30 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT046:EE_|PAVPR08MB9746:EE_|VI1EUR03FT065:EE_|DBBPR08MB5946:EE_ X-MS-Office365-Filtering-Correlation-Id: 2b462772-cf2a-46ab-5b16-08daf3ba02e9 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: vbSyfS9EUtkYUaI+qP285AR+H+ZYi0BSoOPQhSCywCDqXicUC3pvadxMrdhyb+BD5QaDmX9LX4vmX2xRiaK0c5UeFdoKa+p2b8rg6ckSkOWqygInV8mSbx0WqqK3ANLNt1eA4EEnWZCuFblw+WikN2HW5pujdVyYZ++Bxz/i5UyTK564LqGZ5cYubh1CyutSir5pJVOvetZhG1GmdcNwl5cQwk2ahg0YFautKYq+XwWVNhQVrIcUDSgOneu3a+WVag+KRVL0k3RZymmqkTEeJhpH1E67bp1I5D0K4jzxxmBOy5siSj+FC+QrUFKFzs2wpXv7dqvWearhyscAEu4pq86TFTVfrW3zkdZ9vzDVvVe5bQ3M5WncFLCwPUvwFdq3sFPtRudzUWCOcGcvnO9w2I5P/E234s0uzH0vzvh6iYPESgrQsTycv1YmrlwDWZf+cupL0i0ITbkfRJvdcICs/O3UX85TC6nMJ8Vsxot2CyxDNTYs2ppHY2RbB92QShbEeSfj//m5TtoaUIXn5IM8UMrG9PCjlPyGhI9/MDp7GFEaFYIiGIWK5CwvqoRnPBSy8M768soxYMau02V7wwCZzFVMdGRkLQhUHZTl35fDd+C5oAEvwMcOU8uu3IIB5F/9zNygOTuhMeVhxkXm3rBX5WcXzFg0gqZYgcFOVwiCPpC//F+qngxaG4ulRn4lHqCoFiQ+9UDRW1U9sQzNWXMKUQ== 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:(13230022)(4636009)(376002)(346002)(136003)(39860400002)(396003)(451199015)(36840700001)(46966006)(70586007)(4326008)(83380400001)(8676002)(70206006)(5660300002)(36756003)(356005)(6862004)(41300700001)(186003)(26005)(40480700001)(81166007)(478600001)(53546011)(54906003)(82740400003)(316002)(86362001)(47076005)(426003)(82310400005)(336012)(8936002)(2616005)(44832011)(36860700001)(2906002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9746 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT065.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6d62b20a-d1fc-4e55-52da-08daf3b9fd36 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CDpBQ/zywjV6Vd9VrWEyMmwBaMeGi0S8Vq6XrPbke42fsptqqKpEQm84Qzk8rO9FtjBXYJQxrLwMPJSYBETQ6pF531JOBfaXCkhWSVizoJqf/IgcBs2O2bu6ECUtR3Kk0GUKIIEbgu0N1zplD63VvDXEoaXOpkTMQrAtlFEgQkSXTUE0B8fiUi/6uYeZ0YNam2DradtRtsjGIENv52i+OPJmjTYlXxU7aUwA7XeZ2T5IBneTUV+4dvR+OIU83Lm3AzJcdTNRNfPi5upyuoS/qWZBqgFAJpUaLjjaMyAaOr4yG4Wm5aVaxh/5KQpMOX4OSv3Nl58A8+S+xtITrxUrBbQoTbumpxwUAdMI/5ZzKUGX8wo2ZFwAuV+hOs3JUhzlVsZb7oyGLgcOmZre0ihvo7DBueuBhuP/0W+w3KplgStrtSSB0fU1mQKMn88SYVSWGr0IW09W1A7tTjZwqX2StxA1NxpxDc8Y9aQIL/iArHqIkNeVumYUFxtNo0tFWYYeucnmTaUeV3jaEvyhH7pe/22FVCrnj6bHR78731dygE7fE9azZ9xXsvBUPxQ1ex34wMc801Ph6EdNviLxA+9DeVFDISrgu9hwWo9v5bmgVYDTNqi+XJFgFmVOgOeYFqb5sa1TbJNhxjqgoFzQunOOHW7h+HG+tLwR5wXTxHPk8cx51dp7N+S3/aRNkOGzmUdoelKYli+aE85KEl+Qp2xS6g== 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:(13230022)(4636009)(39860400002)(346002)(396003)(136003)(376002)(451199015)(46966006)(40470700004)(36840700001)(54906003)(81166007)(36860700001)(44832011)(36756003)(86362001)(40480700001)(82740400003)(2906002)(316002)(53546011)(83380400001)(2616005)(336012)(26005)(186003)(47076005)(426003)(478600001)(40460700003)(70206006)(70586007)(82310400005)(4326008)(8936002)(8676002)(6862004)(41300700001)(5660300002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2023 09:55:46.3410 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2b462772-cf2a-46ab-5b16-08daf3ba02e9 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: VI1EUR03FT065.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB5946 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Richard Earnshaw writes: > On 09/01/2023 16:48, Richard Earnshaw via Gcc-patches wrote: >> On 09/01/2023 14:58, Andrea Corallo via Gcc-patches wrote: >>> Andrea Corallo via Gcc-patches writes: >>> >>>> Richard Earnshaw writes: >>>> >>>>> On 27/09/2022 16:24, Kyrylo Tkachov via Gcc-patches wrote: >>>>>> >>>>>>> -----Original Message----- >>>>>>> From: Andrea Corallo >>>>>>> Sent: Tuesday, September 27, 2022 11:06 AM >>>>>>> To: Kyrylo Tkachov >>>>>>> Cc: Andrea Corallo via Gcc-patches ; Richa= rd >>>>>>> Earnshaw ; nd >>>>>>> Subject: Re: [PATCH 9/15] arm: Set again stack pointer as CFA >>>>>>> reg when >>>>>>> popping if necessary >>>>>>> >>>>>>> Kyrylo Tkachov writes: >>>>>>> >>>>>>>> Hi Andrea, >>>>>>>> >>>>>>>>> -----Original Message----- >>>>>>>>> From: Gcc-patches >>>>>>>> bounces+kyrylo.tkachov=3Darm.com@gcc.gnu.org> On Behalf Of Andrea >>>>>>>>> Corallo via Gcc-patches >>>>>>>>> Sent: Friday, August 12, 2022 4:34 PM >>>>>>>>> To: Andrea Corallo via Gcc-patches >>>>>>>>> Cc: Richard Earnshaw ; nd >>>>>>>>> Subject: [PATCH 9/15] arm: Set again stack pointer as CFA reg when >>>>>>> popping >>>>>>>>> if necessary >>>>>>>>> >>>>>>>>> Hi all, >>>>>>>>> >>>>>>>>> this patch enables 'arm_emit_multi_reg_pop' to set again the stack >>>>>>>>> pointer as CFA reg when popping if this is necessary. >>>>>>>>> >>>>>>>> >>>>>>>> =C2=A0 From what I can tell from similar functions this is correct, >>>>>>>> but could you >>>>>>> elaborate on why this change is needed for my understanding please? >>>>>>>> Thanks, >>>>>>>> Kyrill >>>>>>> >>>>>>> Hi Kyrill, >>>>>>> >>>>>>> sure, if the frame pointer was set, than it is the current CFA >>>>>>> register. >>>>>>> If we request to adjust the current CFA register offset indicating = it >>>>>>> being SP (while it's actually FP) that is indeed not correct and the >>>>>>> incoherence we will be detected by an assertion in the dwarf emissi= on >>>>>>> machinery. >>>>>> Thanks,=C2=A0 the patch is ok >>>>>> Kyrill >>>>>> >>>>>>> >>>>>>> Best Regards >>>>>>> >>>>>>> =C2=A0=C2=A0=C2=A0 Andrea >>>>> >>>>> Hmm, wait.=C2=A0 Why would a multi-reg pop be updating the stack poin= ter? >>>> >>>> Hi Richard, >>>> >>>> not sure I understand, isn't any pop updating SP by definition? >>> >>> >>> Back on this, >>> >>> compiling: >>> >>> =3D=3D=3D=3D=3D=3D=3D >>> int i; >>> >>> void foo (int); >>> >>> int bar() >>> { >>> =C2=A0=C2=A0 foo (i); >>> =C2=A0=C2=A0 return 0; >>> } >>> =3D=3D=3D=3D=3D=3D=3D >>> >>> With -march=3Darmv8.1-m.main+fp -mbranch-protection=3Dpac-ret+leaf >>> -mthumb -O0 -g >>> >>> Produces the following asm for bar. >>> >>> bar: >>> =C2=A0=C2=A0=C2=A0=C2=A0@ args =3D 0, pretend =3D 0, frame =3D 0 >>> =C2=A0=C2=A0=C2=A0=C2=A0@ frame_needed =3D 1, uses_anonymous_args =3D 0 >>> =C2=A0=C2=A0=C2=A0=C2=A0pac=C2=A0=C2=A0=C2=A0 ip, lr, sp >>> =C2=A0=C2=A0=C2=A0=C2=A0push=C2=A0=C2=A0=C2=A0 {r3, r7, ip, lr} >>> =C2=A0=C2=A0=C2=A0=C2=A0add=C2=A0=C2=A0=C2=A0 r7, sp, #0 >>> =C2=A0=C2=A0=C2=A0=C2=A0ldr=C2=A0=C2=A0=C2=A0 r3, .L3 >>> =C2=A0=C2=A0=C2=A0=C2=A0ldr=C2=A0=C2=A0=C2=A0 r3, [r3] >>> =C2=A0=C2=A0=C2=A0=C2=A0mov=C2=A0=C2=A0=C2=A0 r0, r3 >>> =C2=A0=C2=A0=C2=A0=C2=A0bl=C2=A0=C2=A0=C2=A0 foo >>> =C2=A0=C2=A0=C2=A0=C2=A0movs=C2=A0=C2=A0=C2=A0 r3, #0 >>> =C2=A0=C2=A0=C2=A0=C2=A0mov=C2=A0=C2=A0=C2=A0 r0, r3 >>> =C2=A0=C2=A0=C2=A0=C2=A0pop=C2=A0=C2=A0=C2=A0 {r3, r7, ip, lr} >>> =C2=A0=C2=A0=C2=A0=C2=A0aut=C2=A0=C2=A0=C2=A0 ip, lr, sp >>> =C2=A0=C2=A0=C2=A0=C2=A0bx=C2=A0=C2=A0=C2=A0 lr >>> >>> The offending instruction causing the ICE (without this patch) when >>> emitting dwarf is "pop {r3, r7, ip, lr}". >>> >>> The current CFA reg when emitting the multipop is R7 (the frame >>> pointer).=C2=A0 If is not the multipop that has the duty to restore SP = as >>> current CFA here which other instruction should do it? >>> >> Digging a bit deeper, I'm now even more confused.=C2=A0 >> arm_expand_epilogue contains (parphrasing the code): >> =C2=A0if frame_pointer_needed >> =C2=A0=C2=A0 { >> =C2=A0=C2=A0=C2=A0=C2=A0 if arm >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {} >> =C2=A0=C2=A0=C2=A0=C2=A0 else >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if adjust >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 r7 +=3D ad= just >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mov sp, r7=C2=A0=C2=A0= =C2=A0 // Reset CFA to SP >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >> =C2=A0=C2=A0=C2=A0 } >> so there should always be a move of r7 into SP, even if this is >> strictly redundant.=C2=A0 I don't understand why this doesn't happen for >> your testcase.=C2=A0 Can you dig a bit deeper?=C2=A0 I wonder if we've >> (probably incorrectly) assumed that this function doesn't need an >> epilogue but can use a simple return?=C2=A0 I don't think we should do >> that when authentication is needed: a simple return should really be >> one instruction. >>=20 > > So I strongly suspect the real problem here is that use_return_insn () > in arm.cc needs to be updated to return false when using pointer > authentication. The specification for this function says that a > return can be done in one instruction; and clearly when we need > authentication more than one is needed. > > R. So yes I agree with your analysis. I'm respinning 10/15 to include your suggestion and I believe we can just drop this patch. Thanks Andrea