On Tue, Apr 04, 2006 at 09:05:28AM +1200, Nick Roberts wrote:
> 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.

That's a bug in GDB, and not hard to fix.  You're welcome to do it, or
to file it in GNATS :-)

> 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?

This is not how compiler optimization works.  It is probably an
accident resulting from the compiler's internal representation.
You may want to file it in the GCC bug tracking system, if there is not
already an equivalent bug.

-- 
Daniel Jacobowitz
CodeSourcery

Reply via email to