Subject: Re: does setjmp() save all general purpose CPU registers on all NetBSD
To: NetBSD Kernel Technical Discussion List <tech-kern@NetBSD.ORG>
From: Chris Gilbert <chris@buzzbee.freeserve.co.uk>
List: tech-kern
Date: 08/26/2000 14:10:04
Ignatios Souvatzis wrote:
> 
> On Fri, Aug 25, 2000 at 05:51:10PM -0400, Greg A. Woods wrote:
> > Because I'd been experiencing repeated strange crashes causing broken
> > stack frames with Emacs-20.x on NetBSD I've been helping pretest the
> > upcoming GNU Emacs release (21.0) on NetBSD.  I've been asked to find
> > out if setjmp() saves all registers (which could possibly contain
> > Lisp_Object pointers, presumably any general purpose register that could
> > be used by the compiler for a pointer) in its jmp_buf on all NetBSD
> > architectures.
> 
> Some of the standards people please correct me, but I think only volatile
> variables are guaranteed to be saved.

Yep, non volatile local variables will have an undeterminated state
after the longjmp (sometimes they'll be the value they were at the
setjmp, sometimes the value at the longjmp, depends on the compiler).
See http://www.opengroup.org/onlinepubs/007908799/xsh/setjmp.html, but I
don't know if NetBSD tries to meet this standard though.

Cheers,
Chris