On 26/10/2022 09:49, Andrea Corallo via Gcc-patches wrote:
Richard Earnshaw <richard.earns...@foss.arm.com> writes:

On 27/09/2022 16:24, Kyrylo Tkachov via Gcc-patches wrote:

-----Original Message-----
From: Andrea Corallo <andrea.cora...@arm.com>
Sent: Tuesday, September 27, 2022 11:06 AM
To: Kyrylo Tkachov <kyrylo.tkac...@arm.com>
Cc: Andrea Corallo via Gcc-patches <gcc-patches@gcc.gnu.org>; Richard
Earnshaw <richard.earns...@arm.com>; nd <n...@arm.com>
Subject: Re: [PATCH 9/15] arm: Set again stack pointer as CFA reg when
popping if necessary

Kyrylo Tkachov <kyrylo.tkac...@arm.com> writes:

Hi Andrea,

-----Original Message-----
From: Gcc-patches <gcc-patches-
bounces+kyrylo.tkachov=arm....@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 <gcc-patches@gcc.gnu.org>
Cc: Richard Earnshaw <richard.earns...@arm.com>; nd <n...@arm.com>
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.


  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 emission
machinery.
Thanks,  the patch is ok
Kyrill


Best Regards

    Andrea

Hmm, wait.  Why would a multi-reg pop be updating the stack pointer?

Hi Richard,

not sure I understand, isn't any pop updating SP by definition?

Yes, but the SP must already be the CFA before this instruction, since SP must be the base of the pop. So the reg note changing the CFA to SP can't be right. I'm thinking there must be some earlier restore of SP that's missing a frame-related note.

R.


BR

   Andrea

Reply via email to