Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!rice!uw-beaver!zephyr.ens.tek.com!tekfdi!videovax!bart From: bart@videovax.tv.tek.com (Bart Massey) Newsgroups: comp.lang.perl Subject: Re: Bugs in perl 3.0 pl 8 -- return statement Message-ID: <5716@videovax.tv.tek.com> Date: 14 Feb 90 22:43:43 GMT References: <4080004@hpausla.aso.hp.com> <4080005@hpausla.aso.hp.com> <418@proexam.UUCP> <7000@jpl-devvax.JPL.NASA.GOV> <7068@jpl-devvax.JPL.NASA.GOV> Reply-To: bart@videovax.tv.tek.com (Bart Massey) Organization: Tektronix TV Measurement Systems, Beaverton OR Lines: 33 In article <7068@jpl-devvax.JPL.NASA.GOV> lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes: > 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. Heck, I'll say it. Try running GCC-1.36 -O over the following C code, and be surprised that, at least on the VAX and 68k, the structure member ends up in a register. Note that, at least as of 1.36, this is a very fragile optimization, but it's bound to get nothing but better. ----- struct foo { int a, b; }; main() { struct foo bar; for( bar.b = 0; bar.b < 10; bar.b++ ) nothing( bar.b ); /* force an external reference */ } ----- And the brand-new DecStation 3100 (PMAX) Ultrix compiler does global register optimizations, or so I am told. Aren't compilers wonderful? Bart Massey ..tektronix!videovax.tv.tek.com!bart ..tektronix!reed.bitnet!bart