home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: alt.folklore.computers
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!ukma!netnews.louisville.edu!starbase.spd.louisville.edu!aldavi01
- From: aldavi01@terra.spd.louisville.edu (Arlie Davis)
- Subject: Re: Computer Superstition
- Sender: news@netnews.louisville.edu (Netnews)
- Message-ID: <aldavi01.722544719@starbase.spd.louisville.edu>
- Date: Mon, 23 Nov 1992 18:51:59 GMT
- Reply-To: Arlie Davis <aldavi01@starbase.spd.louisville.edu>
- References: <10292323.7317.11306@kcbbs.gen.nz> <1992Nov18.124517@frej.teknikum.uu.se> <1992Nov20.015335.19860@fcom.cc.utah.edu>
- Nntp-Posting-Host: terra.spd.louisville.edu
- Organization: University of Louisville
- Lines: 27
-
- In <1992Nov20.015335.19860@fcom.cc.utah.edu> bcc@lanai.Eyring.COM (Brian Cooper) writes:
-
- > Ah, but sometimes the magic goes away! I was writing a program where I
- > deliberately used this technique to increase the stack space between
- > recursive invocations and it wouldn't work. Come to find out, two
- > different compilers for two different systems optimized my code by
- > removing the dummy array. Quietly, without any fanfare, the compiler
- > altered the meaning of my code. Logic dictates that if the variable is
- > never referenced, it must not need to be there, right!? I included a
- > stupid reference to the dummy variable and the program worked. I recommend
-
- > char magic[12];
- > magic[0] = magic[1];
-
- > for modern wizards.
-
- Yes, but the latest, greatest super-swanky optimizing compiler may realize
- that only the first two elements in the array are being used. So, you have to
- use the more exotic form:
-
- char magic[12];
- magic[0] = magic[11];
-
- And if a compiler can squeeze /that/ down, well, I give up.
-
- --
- lrwx------ 1 aldavi01 emacsstu 9 Jun 6 12:43 .signature -> /dev/null
-