Joerg Sonnenberger
2015-Feb-10 20:35 UTC
[LLVMdev] Semantics of __builtin_setjmp/__builtin_longjmp
Hi all, currently we lower the __builtin_setjmp/__builtin_longjmp intrinsincs to SjLj exception style intrinsics. For ARM on non-Darwin, they end up as nops, breaking Ruby. This leads to the question of what the defined semantics of them is. (a) Are they supposed to be compatible with libc? PPC disagrees in comments. (b) Are they supposed to be compatible with GCC? If not with libc, why with GCC? Joerg
Tim Northover
2015-Feb-10 21:16 UTC
[LLVMdev] Semantics of __builtin_setjmp/__builtin_longjmp
> (b) Are they supposed to be compatible with GCC?I think they're probably not supposed to be compatible with libc, but should be with GCC. Libc gets to choose its implementation in setjmp.h. It might implement them completely separately (which would still work however we implement the __builtins), or it might make use of the __builtins (in which case we should certainly make sure they're compatible).> If not with libc, why with GCC?Because the GCC builtins are an ABI issue controlled by the compiler: we need to be compatible to mix object files on the platform. Cheers. Tim.
Jim Grosbach
2015-Feb-10 21:32 UTC
[LLVMdev] Semantics of __builtin_setjmp/__builtin_longjmp
Correct on all counts. -Jim> On Feb 10, 2015, at 1:16 PM, Tim Northover <t.p.northover at gmail.com> wrote: > >> (b) Are they supposed to be compatible with GCC? > > I think they're probably not supposed to be compatible with libc, but > should be with GCC. > > Libc gets to choose its implementation in setjmp.h. It might implement > them completely separately (which would still work however we > implement the __builtins), or it might make use of the __builtins (in > which case we should certainly make sure they're compatible). > >> If not with libc, why with GCC? > > Because the GCC builtins are an ABI issue controlled by the compiler: > we need to be compatible to mix object files on the platform. > > Cheers. > > Tim. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev