From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1130) id A244C385843A; Tue, 12 Sep 2023 15:06:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A244C385843A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694531198; bh=2MaiYOfNJaQRfPGWuKLBJZONxLOfLINC9EZAbF1Qhqs=; h=From:To:Subject:Date:From; b=lxJFHhQ7QX113VcIGppgZwmn3d0PGrhgV2Ht/fGFzuhF9Ey8/AtnqMTZxLEh5zU5e STDzf4Wxeknho4yoeOxDJ7LJuKRi/cAY8zMz7Dm0bFSpukUxUG3XGTAYoxzXhU00Cn HJIpeffDNtgbxXKJl+zCccy6bCc1Cj5VfG+W59xA= 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-3893] aarch64: Simplify top of frame allocation X-Act-Checkin: gcc X-Git-Author: Richard Sandiford X-Git-Refname: refs/heads/trunk X-Git-Oldrev: 67a36b6f5d6be11d280081b461e72910aca2fc54 X-Git-Newrev: bc9dcdde80915d7585a21daa2b69f4adf4a1e3c1 Message-Id: <20230912150638.A244C385843A@sourceware.org> Date: Tue, 12 Sep 2023 15:06:38 +0000 (GMT) List-Id: https://gcc.gnu.org/g:bc9dcdde80915d7585a21daa2b69f4adf4a1e3c1 commit r14-3893-gbc9dcdde80915d7585a21daa2b69f4adf4a1e3c1 Author: Richard Sandiford Date: Tue Sep 12 16:05:09 2023 +0100 aarch64: Simplify top of frame allocation After previous patches, it no longer really makes sense to allocate the top of the frame in terms of varargs_and_saved_regs_size and saved_regs_and_above. gcc/ * config/aarch64/aarch64.cc (aarch64_layout_frame): Simplify the allocation of the top of the frame. Diff: --- gcc/config/aarch64/aarch64.cc | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index ca2e6af5d127..9578592d2563 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -8625,23 +8625,16 @@ aarch64_layout_frame (void) frame.saved_regs_size = offset - frame.bytes_below_saved_regs; - poly_int64 varargs_and_saved_regs_size - = frame.saved_regs_size + frame.saved_varargs_size; - - poly_int64 saved_regs_and_above - = aligned_upper_bound (varargs_and_saved_regs_size - + get_frame_size (), - STACK_BOUNDARY / BITS_PER_UNIT); - - frame.bytes_above_hard_fp - = saved_regs_and_above - frame.below_hard_fp_saved_regs_size; + offset += get_frame_size (); + offset = aligned_upper_bound (offset, STACK_BOUNDARY / BITS_PER_UNIT); + auto top_of_locals = offset; - /* Both these values are already aligned. */ - gcc_assert (multiple_p (frame.bytes_below_saved_regs, - STACK_BOUNDARY / BITS_PER_UNIT)); - frame.frame_size = saved_regs_and_above + frame.bytes_below_saved_regs; + offset += frame.saved_varargs_size; + gcc_assert (multiple_p (offset, STACK_BOUNDARY / BITS_PER_UNIT)); + frame.frame_size = offset; - frame.bytes_above_locals = frame.saved_varargs_size; + frame.bytes_above_hard_fp = frame.frame_size - frame.bytes_below_hard_fp; + frame.bytes_above_locals = frame.frame_size - top_of_locals; frame.initial_adjust = 0; frame.final_adjust = 0;