public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/ARM/heads/arm-12-m-pacbti)] [PATCH 9/15] arm: Set again stack pointer as CFA reg when popping if necessary
@ 2022-08-12 16:30 Andrea Corallo
  0 siblings, 0 replies; only message in thread
From: Andrea Corallo @ 2022-08-12 16:30 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:721d4af523814538f266e2d1efa9cfacf1176209

commit 721d4af523814538f266e2d1efa9cfacf1176209
Author: Andrea Corallo <andrea.corallo@arm.com>
Date:   Wed Aug 10 17:05:10 2022 +0200

    [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.
    
    /gcc/
    
            * config/arm/arm.cc (arm_emit_multi_reg_pop): If the frame pointer
            was set define again the stack pointer as CFA reg when popping.

Diff:
---
 gcc/config/arm/arm.cc | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/gcc/config/arm/arm.cc b/gcc/config/arm/arm.cc
index c49c86e75b8..5380abeffe8 100644
--- a/gcc/config/arm/arm.cc
+++ b/gcc/config/arm/arm.cc
@@ -22311,8 +22311,18 @@ arm_emit_multi_reg_pop (unsigned long saved_regs_mask)
 
   REG_NOTES (par) = dwarf;
   if (!return_in_pc)
-    arm_add_cfa_adjust_cfa_note (par, UNITS_PER_WORD * num_regs,
-				 stack_pointer_rtx, stack_pointer_rtx);
+    {
+      /* If the frame pointer was set define again the stack pointer
+         as CFA reg.  */
+      if (frame_pointer_needed)
+        {
+          RTX_FRAME_RELATED_P (par) = 1;
+          add_reg_note (par, REG_CFA_DEF_CFA, stack_pointer_rtx);
+        }
+      else
+        arm_add_cfa_adjust_cfa_note (par, UNITS_PER_WORD * num_regs,
+                                     stack_pointer_rtx, stack_pointer_rtx);
+    }
 }
 
 /* Generate and emit an insn pattern that we will recognize as a pop_multi


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-12 16:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-12 16:30 [gcc(refs/vendors/ARM/heads/arm-12-m-pacbti)] [PATCH 9/15] arm: Set again stack pointer as CFA reg when popping if necessary Andrea Corallo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).