This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: other/59039: Undocumented __builtin_longjmp/__builtin_setjmp
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 11 Nov 2013 19:07:09 +0000
- Subject: Re: PATCH: other/59039: Undocumented __builtin_longjmp/__builtin_setjmp
- Authentication-results: sourceware.org; auth=none
- References: <20131110162819 dot GA6525 at intel dot com>
On Sun, 10 Nov 2013, H.J. Lu wrote:
> +@code{__builtin_setjmp} and @code{__builtin_longjmp} may not be used
> +in the same function with the same @code{setjmp} buffer.
Are there any other restrictions? Do they, for example, guarantee to
restore all call-saved registers to their values at the time of the
__builtin_longjmp call, including those for which libc's setjmp and
longjmp need to test for existence at runtime (but they may have been used
in an intermediate stack frame, even if not enabled in either the setjmp
or longjmp frames)?
Either you need to document all the semantics so as to make clear to users
exactly when they can use these functions safely, or you need to state
that there are undocumented restrictions that may change from GCC version
to GCC version and that these functions are only intended for internal use
as part of GCC's exception handling implementation.
--
Joseph S. Myers
joseph@codesourcery.com