Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!usc!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Bugs in perl 3.0 pl 8 -- return statement Message-ID: <7068@jpl-devvax.JPL.NASA.GOV> Date: 14 Feb 90 01:31:46 GMT References: <4080004@hpausla.aso.hp.com> <4080005@hpausla.aso.hp.com> <418@proexam.UUCP> <7000@jpl-devvax.JPL.NASA.GOV> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 35 In article tom@ssd.csd.harris.com (Tom Horsley) writes: : I think the solution of re-loading the register variables rather than : declaring everything as volatile is a good idea, but it needs one extra : frill (at least the way it is implemented in patch level 8). The variables : you restore the register variables from *DO* need to be declared volatile. : Quite a few of the newer optimizing compilers don't care if you declare a : variable register or not, if they can keep it in a register, they will do : so. : : This also means that some of the non-register variables (which appear to be : referenced across a setjmp) need to be declared volatile, or restored from a : volatile copy just like the register variables. Er, there are three variables that are used to restore registers. cmdparm is already declared volatile. cmd->c_flags is part of a structure, and goto_targ is a global. Are you saying that parts of a structure and global variables also might get put into registers? Actually, I can believe a super-optimizing compiler might put a global into a register. I can't imagine a stucture element, tho. I doubt either is your problem. : I have a problem now compiling with the highest optimization level getting : "panic: corrupt saved stack index" messages, I am perfectly willing to believe : it is an optimizer bug in my compiler, but it may also be a problem with : setjmp/longjmp, I have not had enough time to actually debug it yet (but it : happens the same way with or without JMPCLOBBER). This indicates that the "oldsave" variable is getting clobbered somehow. But that one is also declared volatile. Actually, it's declared VOLATILE. Perhaps VOLATILE isn't getting defined right. Does your cpp define __STDC__? Larry