Path: utzoo!mnetor!tmsoft!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!samsung!mips!daver!bungi.com!news From: news@bungi.com.YorkU.CA Newsgroups: comp.sys.nsc.32k Subject: Re: Bug in minix library setjmp.s; lots of GNU tools diffs available Message-ID: <9102072106.AA01016@manatee.UUCP> Date: 8 Feb 91 02:06:52 GMT References: <<9102071534.5947@munnari.oz.au>> Sender: news@daver.bungi.com Lines: 50 Approved: news@daver.bungi.com > > 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. [stuff deleted] Ian write: > 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! Some time back I ran into this setjump issue while trying to make all the 1.5.10 /usr/src/test programs run successfully. In a nutshell I decided to set ANSI C aside and save all registers. The essence of the decision was (1) that I have yet to run across a situation were saving all registers creates an adverse consequence (thats not to say they do not exist), (2) on numerious occasions not saving the registers has caused me a problem, and (3) in the large, the overhead of saving all registers is minimal. You might say I decided to switch rather than fight. Alternatively, it might be argued that I put off the problem for someone else to solve. Never the less, this is one instance where I do not see the merit of strict ANSI C conformance. My reading of ANSI C is that saving all registers is not in itself a violation of the standard. Rather that the consequence of doing so may on occasion lead to unknowingly writing non-portable code (ie. code that in someway depends upon setjmp saving all registers). Considering that the setjump issue is a problem that we all share, perhaps it would be useful for all of us to adopt a common solution. That is, we collectively agree to (a) save all registers, or (b) actively go on a bug hunt :-). Otherwise, this problem will continue to be a source of frustration, wasted time, generate message traffic, etc. Any thoughts pro or con ?? Obviously, my vote is for ignoring ANSI C and saving all registers -- that is unless someone makes a good case against. johnc -- John Connin: manatee Orlando, Florida UUCP: {uunet,ge-dab,ucf-cs}!tarpit!tous!manatee!johnc