[LLVMdev] llvm-gcc4 and setjmp

Jay Foad jay.foad at antixlabs.com
Fri Sep 21 09:33:06 PDT 2007


Hi Anton,

> Intrisincs are used for representing necessary EH code flow. User's
> setjmp() are just function calls. We fixed recently optimization passes
> not to touch volatile loads/stores. So, now everything connected with
> setjmp should be ok.

I don't think you can treat setjmp() just like a normal function call.
The C standard says that after a longjmp(), non-volatile variables
that have not been changed since the call to setjmp() should have the
correct value. To implement this, I think the compiler needs to know
that in a function that calls setjmp(), it shouldn't keep any such
variables in callee-saves registers across a call.

Jay.



More information about the llvm-dev mailing list