Nick Roberts wrote:
Its
interesting that a quote on Bugzilla says that debugging is twice as hard as
writing code.
This need not be the case, if you adopt sufficient discipline to write
correct code the first time, debugging can be a minor part of the
development process. Far too many people are in the habit these days
of writing sloppy code and then spending ages bashing it into shape
with the debugger :-(
Well, off topic, I know, but the above quote irritated me!
I'm sure that GDB can be rewritten to overcome this but what other
optimizations do/will GCC developers decide users must have? The above
optimization seems just to save a few bytes unless a program is deeply nested.
Why not reserve it for -O1 and higher?
In fact I agree that -O0 should not do any optimizations visible to
the user of the debugger at the source level (I wish it would do a
bit better job of generating reasonable code, subject to this criterion!)