> They've been optimized away.  Not surprising, since they are unused,
 > although slightly surprising that it happened with -O0.

The manual says:

  `-O0'
       Do not optimize.  This is the default.

so that seems to be a documentation bug at least.  More generally, it seems
odd to force an optimization on a user that he might not want.  Its
interesting that a quote on Bugzilla says that debugging is twice as hard as
writing code.  If thats the case, theres no point in making it any harder.
It also causes GDB to generate errors on the output of other commands:

  (gdb) info locals
  argc = Cannot access memory at address 0x0

as well as the GDB/MI equivalent -stack-list-locals.  This breaks the front
end that I'm writing fo Emacs.

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?


Nick                                           http://www.inet.net.nz/~nickrob

Reply via email to