https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124021
--- Comment #3 from Peter Bergner <bergner at gcc dot gnu.org> --- (In reply to Jeffrey A. Law from comment #0) > Vector loads/stores implicitly set vstart on risc-v. Therefore if we have > an interrupt routine that uses any vector code, we need to save/restore > vstart in the prologue/epilogue. This is confusing to me. We don't rely on saving and restoring vector registers, since those should be saved in the *context structure by the kernel and then automatically restored by the kernel when returning from the interrupt/signal handler. I see struct __riscv_v_ext_state in the kernel has a vstart field, so why isn't that restored on exit? Or am I missing something?
