public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-9861] aarch64: Only calculate chain_offset if there is a chain
@ 2023-09-12 15:09 Richard Sandiford
  0 siblings, 0 replies; only message in thread
From: Richard Sandiford @ 2023-09-12 15:09 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:2b983f9064d808daf909bde1d4a13980934a7e6e

commit r12-9861-g2b983f9064d808daf909bde1d4a13980934a7e6e
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Tue Sep 12 16:08:51 2023 +0100

    aarch64: Only calculate chain_offset if there is a chain
    
    After previous patches, it is no longer necessary to calculate
    a chain_offset in cases where there is no chain record.
    
    gcc/
            * config/aarch64/aarch64.cc (aarch64_expand_prologue): Move the
            calculation of chain_offset into the emit_frame_chain block.

Diff:
---
 gcc/config/aarch64/aarch64.cc | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index e79551af41df..d71a042d6112 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -9747,16 +9747,16 @@ aarch64_expand_prologue (void)
   if (callee_adjust != 0)
     aarch64_push_regs (reg1, reg2, callee_adjust);
 
-  /* The offset of the frame chain record (if any) from the current SP.  */
-  poly_int64 chain_offset = (initial_adjust + callee_adjust
-			     - frame.hard_fp_offset);
-  gcc_assert (known_ge (chain_offset, 0));
-
   /* The offset of the current SP from the bottom of the static frame.  */
   poly_int64 bytes_below_sp = frame_size - initial_adjust - callee_adjust;
 
   if (emit_frame_chain)
     {
+      /* The offset of the frame chain record (if any) from the current SP.  */
+      poly_int64 chain_offset = (initial_adjust + callee_adjust
+				 - frame.hard_fp_offset);
+      gcc_assert (known_ge (chain_offset, 0));
+
       if (callee_adjust == 0)
 	{
 	  reg1 = R29_REGNUM;

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

only message in thread, other threads:[~2023-09-12 15:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-12 15:09 [gcc r12-9861] aarch64: Only calculate chain_offset if there is a chain Richard Sandiford

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).