https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117267
--- Comment #6 from Stas Sergeev <stsp at users dot sourceforge.net> --- In order to restore the stack, I need it to be inlined. Otherwise it won't restore the right stack. But even in that case it generates this: Dump of assembler code for function setjmp: => 0x0000000000401160 <+0>: push %rbp 0x0000000000401161 <+1>: xor %eax,%eax 0x0000000000401163 <+3>: mov %rbp,(%rdi) 0x0000000000401166 <+6>: movq $0x401160,0x8(%rdi) <-- return address is the beginning of the function! 0x000000000040116e <+14>: mov %rsp,0x10(%rdi) 0x0000000000401172 <+18>: pop %rbp 0x0000000000401173 <+19>: ret As you can see, it saves the wrong return address. As the result it never returns a non-zero value, even after a jump. Can you at least try the test-case?