aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorFei Gao <gaofei@eswincomputing.com>2023-04-29 09:35:00 -0600
committerJeff Law <jlaw@ventanamicro>2023-04-29 09:35:00 -0600
commita5b2a3bff8152aa34408d8ce40add82f4d22ff87 (patch)
tree15f95a44e2f2478afb3c7ac410c940db22daa053 /libcpp
parent502051957444a2fc392dd973e978664e2cd0be2b (diff)
downloadgcc-a5b2a3bff8152aa34408d8ce40add82f4d22ff87.zip
gcc-a5b2a3bff8152aa34408d8ce40add82f4d22ff87.tar.gz
gcc-a5b2a3bff8152aa34408d8ce40add82f4d22ff87.tar.bz2
RISC-V: decouple stack allocation for rv32e w/o save-restore
Currently in rv32e, stack allocation for GPR callee-saved registers is always 12 bytes w/o save-restore. Actually, for the case without save-restore, less stack memory can be reserved. This patch decouples stack allocation for rv32e w/o save-restore and makes riscv_compute_frame_info more readable. output of testcase rv32e_stack.c before patch: addi sp,sp,-16 sw ra,12(sp) call getInt sw a0,0(sp) lw a0,0(sp) call PrintInts lw a5,0(sp) mv a0,a5 lw ra,12(sp) addi sp,sp,16 jr ra after patch: addi sp,sp,-8 sw ra,4(sp) call getInt sw a0,0(sp) lw a0,0(sp) call PrintInts lw a5,0(sp) mv a0,a5 lw ra,4(sp) addi sp,sp,8 jr ra gcc/ChangeLog: * config/riscv/riscv.cc (riscv_avoid_save_libcall): helper function for riscv_use_save_libcall. (riscv_use_save_libcall): call riscv_avoid_save_libcall. (riscv_compute_frame_info): restructure to decouple stack allocation for rv32e w/o save-restore. gcc/testsuite/ChangeLog: * gcc.target/riscv/rv32e_stack.c: New test.
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions