RISC-V: Add support to vector stack-clash protection
Adds basic support to vector stack-clash protection using a loop to do the probing and stack adjustments. gcc/ChangeLog: * config/riscv/riscv.cc (riscv_allocate_and_probe_stack_loop): New function. (riscv_v_adjust_scalable_frame): Add stack-clash protection support. (riscv_allocate_and_probe_stack_space): Move the probe loop implementation to riscv_allocate_and_probe_stack_loop. * config/riscv/riscv.h: Define RISCV_STACK_CLASH_VECTOR_CFA_REGNUM. gcc/testsuite/ChangeLog: * gcc.target/riscv/stack-check-cfa-3.c: New test. * gcc.target/riscv/stack-check-prologue-16.c: New test. * gcc.target/riscv/struct_vect_24.c: New test.
Showing
- gcc/config/riscv/riscv.cc 78 additions, 21 deletionsgcc/config/riscv/riscv.cc
- gcc/config/riscv/riscv.h 5 additions, 0 deletionsgcc/config/riscv/riscv.h
- gcc/testsuite/gcc.target/riscv/stack-check-cfa-3.c 13 additions, 0 deletionsgcc/testsuite/gcc.target/riscv/stack-check-cfa-3.c
- gcc/testsuite/gcc.target/riscv/stack-check-prologue-16.c 30 additions, 0 deletionsgcc/testsuite/gcc.target/riscv/stack-check-prologue-16.c
- gcc/testsuite/gcc.target/riscv/struct_vect_24.c 47 additions, 0 deletionsgcc/testsuite/gcc.target/riscv/struct_vect_24.c
Loading
Please register or sign in to comment