Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!mips!daver!bungi.com!news Newsgroups: comp.sys.nsc.32k Subject: Re: Bug in minix library setjmp.s; lots of GNU tools diffs available Message-ID: <9102072159.AA02808@halsoft> Date: 7 Feb 91 21:59:38 GMT Sender: news@daver.bungi.com Lines: 28 Approved: news@daver.bungi.com 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 write: Ian is correct. Nevertheless all of the following compilers produce the result that Jyrki K's claims is correct: Gcc on 386 Gcc on Sun-3 (68020) Cc on 386 (pcc based) Cc on Sun (probably pcc based) Microsoft C (claims to be ANSI compatible) So it seems that's the way it isn't. 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. Jonathan Ryshpan <...!uunet!hitachi!jon>