]> 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>
Mon, 30 Jun 2025 19:58:29 +0000 (13:58 -0600)
commit45a17e3081120f51f8e8b1d7cda73c7d89453e85
tree21ff9e25c26f23f5a2654ba073a2b96b9a6acb5a
parent8ea555b7b4725dbc5d9286f729166cd54ce5b615
[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.
gcc/config/riscv/riscv.cc
gcc/testsuite/gcc.target/riscv/pr120714.c [new file with mode: 0644]