This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Function parameter debug info at -O0


On Mon, Aug 06, 2012 at 01:40:57PM -0400, Frank Ch. Eigler wrote:
> Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> writes:
> 
> > [...]
> > The following program, when compiled with -O0 -g3 (x86_64 target, but
> > doesn't seem to matter), shows wrong values for p (function parameter)
> > when debugging. [...]
> 
> This sounds like <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51358>.
> 

I guess that's a different issue - that bug talks about debug info for
formal parameters being invalid before they are pushed on the stack. In
the case I described, it stays wrong for the entire body of the
function. 

The core of the problem appears to be that a formal parameter
that is not read from but written to, is allocated space on the stack twice - 
once when expand_used_vars runs, and once when expand_function_start
runs. The debug information generated for the formal parameter only
points to the space allocated by the former, and thus does not reflect
writes to the variable that occur on the space allocated by the
latter.

Regards
Senthil


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]