Date: Fri, 13 Jan 1995 19:40:14 -0800 From: drupp AT cs DOT washington DOT edu (Douglas Rupp) To: dj AT stealth DOT ctron DOT com, djgpp AT sun DOT soe DOT clarkson DOT edu, drupp AT cs DOT washington DOT edu, enrico AT max DOT tiac DOT net Subject: Re: gcc = gcc -O2 ? Previously: DR> I also like the idea of gcc -g implying gcc -g -O0. I don't understand exactly what the advantages of this could possibly be. Will the program be easier to debug if it's slower? Theoretically, that should be the only difference optimization makes... ------------------------------------------------------------------------------ The problem of trying to debug optimized code are that the compiler, during optimization can do lots of things to move things around and reorganize your code so that things aren't where you had them originally, i.e the assembly code may not match your source anymore. Generally, I think people don't try to debug optimized code, unless the problem only appears when optimizations are turned on. By debug I mean use a source level debugger such as gdb. Using the old standby method of "printfs" wouldn't make much difference as far as having optimizations on or off, of course.