]> git.ipfire.org Git - thirdparty/gcc.git/commit
[RISC-V] Correct CFA notes for stack-clash protection [PR120714]
authorAlexey Merzlyakov <alexey.merzlyakov@samsung.com>
Mon, 30 Jun 2025 19:58:29 +0000 (13:58 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Sun, 27 Jul 2025 15:17:36 +0000 (09:17 -0600)
commit93eeb52a81b2a6c11917b14549ff5a5aeb37af8f
tree83cb664d555cd02f6e5bd56ba2e0c918f41c6c65
parent4f3b1f3c0e6f07cc4aaafdeb41909ac3e9f607a6
[RISC-V] Correct CFA notes for stack-clash protection [PR120714]

Fixes incorrect SP-addresses used in CFA notes for the stack probes
unrelative to the frame's top. It applied to the RISC-V targets code
generation when the stack-clash protection is enabled.

PR target/120714
gcc/ChangeLog:

* config/riscv/riscv.cc (riscv_allocate_and_probe_stack_space):
Fix SP-addresses in REG_CFA_DEF_CFA notes for stack-clash case.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/pr120714.c: New test.

(cherry picked from commit 45a17e3081120f51f8e8b1d7cda73c7d89453e85)
gcc/config/riscv/riscv.cc
gcc/testsuite/gcc.target/riscv/pr120714.c [new file with mode: 0644]