]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: Add bytes_below_hard_fp to frame info
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 12 Sep 2023 15:05:06 +0000 (16:05 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 12 Sep 2023 15:05:06 +0000 (16:05 +0100)
commit99305f306246079cc57d30dae7c32107f02ff3e8
tree38a3229ecf9910273726dec07348f129f52298c0
parent7b792ecaa9414bc81520b3da552d40ad854be976
aarch64: Add bytes_below_hard_fp to frame info

Following on from the previous bytes_below_saved_regs patch, this one
records the number of bytes that are below the hard frame pointer.
This eventually replaces below_hard_fp_saved_regs_size.

If a frame pointer is not needed, the epilogue adds final_adjust
to the stack pointer before restoring registers:

     aarch64_add_sp (tmp1_rtx, tmp0_rtx, final_adjust, true);

Therefore, if the epilogue needs to restore the stack pointer from
the hard frame pointer, the directly corresponding offset is:

     -bytes_below_hard_fp + final_adjust

i.e. go from the hard frame pointer to the bottom of the frame,
then add the same amount as if we were using the stack pointer
from the outset.

gcc/
* config/aarch64/aarch64.h (aarch64_frame::bytes_below_hard_fp): New
field.
* config/aarch64/aarch64.cc (aarch64_layout_frame): Initialize it.
(aarch64_expand_epilogue): Use it instead of
below_hard_fp_saved_regs_size.
gcc/config/aarch64/aarch64.cc
gcc/config/aarch64/aarch64.h