This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: handling setjmp/longjmp in new front-end
- To: Fergus Henderson <fjh at cs dot mu dot oz dot au>
- Subject: Re: handling setjmp/longjmp in new front-end
- From: Richard Henderson <rth at redhat dot com>
- Date: Fri, 29 Dec 2000 00:38:36 -0800
- Cc: gcc at gcc dot gnu dot org
- References: <20001229182700.A15443@hg.cs.mu.oz.au>
On Fri, Dec 29, 2000 at 06:27:00PM +1100, Fergus Henderson wrote:
> The existing Mercury compiler generates C code that uses
> setjmp() and longjmp().
For what do you use setjmp/longjmp? Perhaps you really want
to be using gcc's exception handling mechanisms?
> What exactly are the restrictions? Is it just that __builtin_longjmp()
> must always be called with the second argument being `1', or is there
> more to it?
The only extra restriction that I am aware of is that you cannot
__builtin_longjmp to a jmpbuf within the current function.
> Are __builtin_setjmp() and __builtin_longjmp() supported on all targets?
Yes.
r~