From: Bernard Schmitz Newsgroups: comp.os.msdos.djgpp Subject: problem with profiling with optimization... Date: Tue, 05 May 1998 15:31:00 +1000 Organization: HunterLink - An Australian Network Provider Lines: 28 Message-ID: <354EA414.7DCA7172@hunterlink.net.au> NNTP-Posting-Host: new6as4.hunterlink.net.au Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Is profiling with optimization liable to break code? I've always profiled using the flags -g -pg -m486 -O3 and never had a problem until now. My code was working fine compiled with debug info. I decided to profile it and found that it produced different results! At first I thought it was a bug that had only become apparent because of profiling/optimizing. I compiled with optimization using -O3 -m486 -finline-functions -fomit-frame-pointer and the code worked perfectly! Compiling the same code with profiling but no optimization works. That will do, but I was surprised that the profiling/optimization affected just a small section of code, just one function in fact! So basically is it a good idea to profile using optimization?? Can you turn off profiling for one function? thanks -- Bernard Schmitz bernard AT hunterlink DOT net DOT au GeekCode V3.1: GCS d- s:++ a- C++$ UL++++ P+++>++++ L+++ E--- W+ N+++ o? !K w@ O- M- V-- PS+ PE-- Y+ PGP- t+@ 5+@ X+@ !R !tv b+++(+) DI? D+(----) G++ e+>++ h r y?