Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!daver!bungi.com!news Newsgroups: comp.sys.nsc.32k Subject: Returned mail: Cannot send message for 3 days Message-ID: <9102180213.AA18751@uunet.UU.NET> Date: 12 Feb 91 03:01:48 GMT Sender: news@daver.bungi.com Lines: 66 Approved: news@daver.bungi.com ----- Transcript of session follows ----- 421 bnrgate.tcp... Deferred ----- Unsent message follows ----- Received: by bnr-vpa; Thu, 14 Feb 91 19:11:16 est Return-Path: Received: from utzoo with uucp; Mon, 11 Feb 00 22:01:48 Received: by neat.cs.toronto.edu with UUCP id <12507>; Thu, 14 Feb 1991 17:31:27 -0500 Received: from daver.UUCP by uunet.UU.NET (5.61/1.14) with UUCP id AA01796; Thu, 14 Feb 91 17:23:22 -0500 Received: by daver.bungi.com (/\=-/\ Smail3.1.18.1 #18.16) id ; Thu, 14 Feb 91 14:07 PST X-Path: news From: tim@proton.amd.com (Tim Olson) To: xm-pc532@daver.bungi.com Subject: Re: Bug in minix library setjmp.s; lots of GNU tools diffs available Date: Mon, 11 Feb 1991 22:01:48 -0500 Message-Id: <1991Feb12.3148.0@proton.amd.com> Illegal-Object: Syntax error in References: value found on neat.cs.toronto.edu: References: <<9102072159.AA02808@halsoft>> ^ ^-illegal reference separator \-expected word, illegal end of message identification Reply-To: pc532@bungi.com Organization: Advanced Micro Devices, Austin, TX Precedence: bulk In article <9102072159.AA02808@halsoft> writes: | Ian writes: | >Jyrki Kuoppala writes: | > - When porting emacs to pc532-Minix, I noticed there's a bug in the | > - setjmp library routine - it doesn't save registers r3-r7 (and f4-f7) | > - which I think it should do. | ... | >I believe in ANSI C, there is no requirement to save registers in setjump. | >Variables which have to be accessed after the setjump should be marked | >volatile. Yes, some people have said that is ugly and nor the way it | >should be done, but I pretty sure, that is the way it is! | | I suspect that register variables ought to be preserved despite what the | ANSI standard says, particularly since well optimized C compilers put | everything they can into registers whether or not they are declared | register. Actually, the most "correct" implementation of setjmp/longjmp is to ensure that all automatic variables, like statics and externals, have the value they had at the time of the longjmp. Saving register values in the jmpbuf causes those that were actually in registers to have the values they had at the time of the setjmp (but externals and automatics not in registers have their longjmp value). The reason the ANSI standard specified that the values of non-volatile automatics are not to be relied upon (how's that for a double-negative! ;-) is that: 1) There exist "correct" implementations (VAX with stack-unwind longjmp, register-windowed RISC processors). 2) There exist "register save" implementations. 3) Forcing one or the other to be the standard would be prohibitive on various architectures. -- -- Tim Olson Advanced Micro Devices (tim@amd.com)