[LLVMdev] llvm-gcc4 and setjmp

Jay Foad jay.foad at antixlabs.com
Fri Aug 24 06:16:57 PDT 2007


Hi Anton,

> > I would expect llvm-gcc to use LLVM's setjmp/longjmp intrinsics and
> > then to run the LowerSetJmp pass to turn the intrinsic calls into uses
> > of invoke and unwind. At that point, the control flow is explicit,
> > isn't it?
> Unfortunately, no. You can call setjmp/longjmp on the same jump buffer
> multiple times. So, in general it's not possible to determine, where
> jump destination is. The problem is much worse in case, when jump buffer
> escapes from the function, where it was initialized (like in your case -
> longjmp is called in the g() routine).

LowerSetJmp should handle this by turning the call to g() into an invoke. If
g() calls longjmp(), it will do an unwind.

Are you saying that the LowerSetJmp pass doesn't work? Or that the whole
idea of lowering setjmp/longjmp to invoke/unwind doesn't work?

Thanks,
Jay.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070824/9f30170a/attachment.html>


More information about the llvm-dev mailing list