[llvm-dev] setjmp/longjmp and volatile stores, but non-volatile loads

Jonas Maebe via llvm-dev llvm-dev at lists.llvm.org
Sun Dec 18 23:58:51 PST 2016


Jonas Maebe via llvm-dev wrote:
> Then, I tried the following:
> a) if the longjmp for the try-block is taken (i.e., the setjmp right
> before the try-block returns a non-zero value), jump to the landingpad BBL.
> 
> -> Problem: LLVM does not allow regular jump edges to landingpad BBLs
> 
> b) since the landingpad is empty anyway and falls through into the next
> BBL (which contains the start of our actual exception handling code),
> jump to that next BBL from setjmp.
> 
> -> Problem: even though I do not insert code in the landingpad BBLs,
> LLVM may still add code to them, e.g. for (LLVM-created) phi-nodes.

Actually, there's another —even more fundamental— problem: the longjmp
will always restore the non-volatile registers to the contents they had
at the start of the try-block, which is not what LLVM expects when
entering an SEH-based landing pad.


Jonas


More information about the llvm-dev mailing list