Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!uunet!tiamat!jim From: jim@tiamat.fsc.com ( IT Manager) Newsgroups: comp.sys.hp Subject: Re: cc optimizer dies on a few perl.4.0.beta files Message-ID: <821@tiamat.fsc.com> Date: 29 Mar 91 20:55:44 GMT References: <7370347@hpfcso.FC.HP.COM> Organization: Ahlstrom Filtration - Chattanooga,TN Lines: 24 In article <7370347@hpfcso.FC.HP.COM>, mike@hpfcso.FC.HP.COM (Mike McNelly) writes: > > It's quite possible that the optimizer had a bug in it. It's also quite > possible that the source program had a bug that was unmasked by > optimization (this happens a lot). Until the problem is tracked down no > one will ever know for sure. We ran into a snag with -O that pointed out some poor programming habits (or probably just a mistake we over looked). As it happened, I left out the code to initialize a variable before use. I never noticed, cause apparently, without -O, the compiler decided to be nice and initialize it for me. Once the program was "finished", and I added -O to the Makefile, it no longer worked. After some playing, I finally figured out the error, and added the code to initialize the variable, and compiling with -O worked just fine. Apparently, the optimizer said "you want things optimized, and initializing something for you takes extra cycles, so I won't do it - Nyah!" (insert picture of compiler with its toungue sticking out :-). I never got a warning or error message in either case, so either I don't have the warning message level set right, or the compiler just doesn't tell you about these things I should remember to do in the first place. ------------- James B. O'Connor jim@tiamat.fsc.com Ahlstrom Filtration, Inc. 615/821-4022 x. 651