Skip to content
Snippets Groups Projects
Commit 180ede35 authored by Raphael Moreira Zinsly's avatar Raphael Moreira Zinsly
Browse files

RISC-V: Enable stack clash in alloca

Add the TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE to riscv in
order to enable stack clash protection when using alloca.
The code and tests are the same used by aarch64.

gcc/ChangeLog:
	* config/riscv/riscv.cc (riscv_compute_frame_info): Update
	outgoing args size.
	(riscv_stack_clash_protection_alloca_probe_range): New.
	(TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE): New.
	* config/riscv/riscv.h
	(STACK_CLASH_MIN_BYTES_OUTGOING_ARGS): New.
	(STACK_DYNAMIC_OFFSET): New.

gcc/testsuite/ChangeLog:
	* gcc.target/riscv/stack-check-14.c: New test.
	* gcc.target/riscv/stack-check-15.c: New test.
	* gcc.target/riscv/stack-check-alloca-1.c: New test.
	* gcc.target/riscv/stack-check-alloca-2.c: New test.
	* gcc.target/riscv/stack-check-alloca-3.c: New test.
	* gcc.target/riscv/stack-check-alloca-4.c: New test.
	* gcc.target/riscv/stack-check-alloca-5.c: New test.
	* gcc.target/riscv/stack-check-alloca-6.c: New test.
	* gcc.target/riscv/stack-check-alloca-7.c: New test.
	* gcc.target/riscv/stack-check-alloca-8.c: New test.
	* gcc.target/riscv/stack-check-alloca-9.c: New test.
	* gcc.target/riscv/stack-check-alloca-10.c: New test.
	* gcc.target/riscv/stack-check-alloca.h: New.
parent 2862d99b
No related branches found
No related tags found
Loading
Showing
with 219 additions and 0 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment