On 6/19/2026 8:54 PM, Peter Bergner wrote:
> I had this sitting around waiting for stage1 to reopen before posting,
> but I seemed to have lost track of it.  I know GLIBC's riscv port does
> preserve all callee-saved registers, but I'm unsure what all the other
> libcs on riscv do, so for safety, I limited the usage to GLIBC.
> I can drop that if everyone knows all riscv libcs act the same way.
>
> This was regtested on riscv64-linux with no regressions.
> Ok for trunk?
>
> Peter
>
>
> RISC-V: GLIBC's setjmp preserves callee-saved registers [PR87466]
>
> gcc/
>       PR target/87466
>       * config/riscv/riscv.cc (TARGET_SETJMP_PRESERVES_NONVOLATILE_REGS_P):
>       Define.
Obviously we can refine to include other libcs once someone chimes in on 
their semantics.

My only worry would be cases where we have the ability to dynamically 
select a different libc implementation.  Is that really a thing these 
days?  I glibc vs musl, newlib vs pico, others?  Not sure where hte LLVM 
libc projects fit in either.

Jeff

Reply via email to