[llvm] [RISCV] Emit lpad for function with returns-twice attribute (PR #170520)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 3 10:44:21 PST 2025


topperc wrote:

> Recently, discussions in RISC-V glibc has agreed to use the returns_twice / indirect_return(gcc only) attributes to instruct the compiler to insert the landing pad after the functions that could return from a indirect branch (e.g. setcontext, swapcontext, setjmp), so that these functions could use a normal indirect branch which is safer than a software-guarded branch.

Is this a mailing list discussion that you can link to?

https://github.com/llvm/llvm-project/pull/170520


More information about the llvm-commits mailing list