From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1130) id 0432C3858020; Tue, 12 Sep 2023 15:06:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0432C3858020 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694531173; bh=4/gr2WP18tMk2vb7aHAH7M3TLwvBfPkhjgZaDpa21TY=; h=From:To:Subject:Date:From; b=iI+6SzPFigtUJS06AacseLpXiM7Z/qJBd9pkVO6UJv34EcuxUUTZcr0dFEuVgt/cx M1HQcFj4O2R0LIxrsf3Yo5xR+vgI+F+KKJP3fesTHXYJ+taQtMT496XB+BYduwNsZ1 HTgAylQ4nMsUDU6RKM/HGaDGttuTZ1Rew8GPO4mM= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Sandiford To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-3888] aarch64: Only calculate chain_offset if there is a chain X-Act-Checkin: gcc X-Git-Author: Richard Sandiford X-Git-Refname: refs/heads/trunk X-Git-Oldrev: 38698967268c44991e02aa1e5a2ce9382d6de9db X-Git-Newrev: aa8b57ee0206e8e5ac7078692ee67fb6ead05645 Message-Id: <20230912150613.0432C3858020@sourceware.org> Date: Tue, 12 Sep 2023 15:06:13 +0000 (GMT) List-Id: https://gcc.gnu.org/g:aa8b57ee0206e8e5ac7078692ee67fb6ead05645 commit r14-3888-gaa8b57ee0206e8e5ac7078692ee67fb6ead05645 Author: Richard Sandiford Date: Tue Sep 12 16:05:07 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 2c218c909061..25b5fb243a6f 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -10111,16 +10111,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;