aboutsummaryrefslogtreecommitdiff
path: root/gcc/config.gcc
diff options
context:
space:
mode:
authorMonk Chiang <monk.chiang@sifive.com>2024-11-15 13:38:48 +0800
committerMonk Chiang <monk.chiang@sifive.com>2025-01-17 10:49:16 +0800
commitdc76aa0e4d5398104b6b26f08b46524b97de5100 (patch)
tree7210fc03f9544ca682238548dd4768490651e16e /gcc/config.gcc
parent29da6a642402ac64002f5edeab268606b4637103 (diff)
downloadgcc-dc76aa0e4d5398104b6b26f08b46524b97de5100.zip
gcc-dc76aa0e4d5398104b6b26f08b46524b97de5100.tar.gz
gcc-dc76aa0e4d5398104b6b26f08b46524b97de5100.tar.bz2
RISC-V: Add Zicfiss ISA extension.
This patch is implemented according to the RISC-V CFI specification. It supports the generation of shadow stack instructions in the prologue, epilogue, non-local gotos, and unwinding. RISC-V CFI SPEC: https://github.com/riscv/riscv-cfi gcc/ChangeLog: * common/config/riscv/riscv-common.cc: Add ZICFISS ISA string. * config/riscv/predicates.md: New predicate x1x5_operand. * config/riscv/riscv.cc (riscv_expand_prologue): Insert shadow stack instructions. (riscv_expand_epilogue): Likewise. (riscv_for_each_saved_reg): Assign t0 or ra register for sspopchk instruction. (need_shadow_stack_push_pop_p): New function. Omit shadow stack operation on leaf function. * config/riscv/riscv.h (need_shadow_stack_push_pop_p): Define. * config/riscv/riscv.md: Add shadow stack patterns. (save_stack_nonlocal): Add shadow stack instructions for setjump. (restore_stack_nonlocal): Add shadow stack instructions for longjump. * config/riscv/riscv.opt (TARGET_ZICFISS): Define. libgcc/ChangeLog: * config/riscv/linux-unwind.h: Include shadow-stack-unwind.h. * config/riscv/shadow-stack-unwind.h (_Unwind_Frames_Extra): Define. (_Unwind_Frames_Increment): Define. gcc/testsuite/ChangeLog: * gcc.target/riscv/ssp-1.c: New test. * gcc.target/riscv/ssp-2.c: New test. Co-Developed-by: Greg McGary <gkm@rivosinc.com>, Kito Cheng <kito.cheng@gmail.com>
Diffstat (limited to 'gcc/config.gcc')
0 files changed, 0 insertions, 0 deletions