On 6/14/23 01:57, Jin Ma wrote:
In order to avoid interrupt functions to change the FCSR, it needs to be saved
and restored at the beginning and end of the function.

gcc/ChangeLog:

        * config/riscv/riscv.cc (riscv_compute_frame_info): Allocate frame for 
FCSR.
        (riscv_for_each_saved_reg): Save and restore FCSR in interrupt 
functions.
        * config/riscv/riscv.md (riscv_frcsr): New patterns.
        (riscv_fscsr): Likewise.

gcc/testsuite/ChangeLog:

        * gcc.target/riscv/interrupt-fcsr-1.c: New test.
        * gcc.target/riscv/interrupt-fcsr-2.c: New test.
        * gcc.target/riscv/interrupt-fcsr-3.c: New test.
Thanks.  I pushed this to the trunk.
jeff

Reply via email to