]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Only Save/Restore required registers for ILP32E/LP64E
authorJim Lin <jim@andestech.com>
Fri, 19 Sep 2025 13:08:09 +0000 (07:08 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Fri, 19 Sep 2025 13:09:21 +0000 (07:09 -0600)
commitafdf44154fd2b54f9f8b6055fae800d4fce7f05c
tree4b8ee4fa7612337e6a1ffe1db10f0cefaca74b70
parent4f01f39d021435bc18d3ce3b0fa1e576c8457606
RISC-V: Only Save/Restore required registers for ILP32E/LP64E

Previously the spec
https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/70
has changed the save/restore routines to save/restore the registers which
are really used for ILP32E/LP64 rather than always save/restore all
of ra/s0/s1.

I also found here that lacks the implementation for lp64e. If it's
necessary I will file anothor patch for that.

gcc/ChangeLog:

* config/riscv/riscv.cc (riscv_compute_frame_info): Remove the
dedicated calculation for RVE.

libgcc/ChangeLog:

* config/riscv/save-restore.S: Only save/restore the registers
which are really used for ILP32E/LP64.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/save-restore-cfi-3.c: New test.
gcc/config/riscv/riscv.cc
gcc/testsuite/gcc.target/riscv/pr120811.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/save-restore-cfi-3.c [new file with mode: 0644]
libgcc/config/riscv/save-restore.S