]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: XTheadMemPair: Fix missing fcsr handling in ISR prologue/epilogue
authorJin Ma <jinma@linux.alibaba.com>
Fri, 10 Nov 2023 07:14:31 +0000 (15:14 +0800)
committerChristoph Müllner <christoph.muellner@vrull.eu>
Fri, 10 Nov 2023 13:26:12 +0000 (14:26 +0100)
commitb70ad8c19aa8be672cdba6afe9cbab2d1254d127
tree12bcbc9d77bc8cb01fd3522308d8e7a36a3853d3
parente5f1956498251a4973d52c8aad3faf34d0443169
RISC-V: XTheadMemPair: Fix missing fcsr handling in ISR prologue/epilogue

The t0 register is used as a temporary register for interrupts, so it needs
special treatment. It is necessary to avoid using "th.ldd" in the interrupt
program to stop the subsequent operation of the t0 register, so they need to
exchange positions in the function "riscv_for_each_saved_reg".

gcc/ChangeLog:

* config/riscv/riscv.cc (riscv_for_each_saved_reg): Place the interrupt
operation before the XTheadMemPair.
gcc/config/riscv/riscv.cc
gcc/testsuite/gcc.target/riscv/xtheadmempair-interrupt-fcsr.c [new file with mode: 0644]