This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Further debuginfo fixes for VLAs and nested functions
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org, Jason Merrill <jason at redhat dot com>, Jan Kratochvil <jkratoch at redhat dot com>
- Date: Thu, 23 Apr 2009 20:49:44 +0200
- Subject: Re: [PATCH] Further debuginfo fixes for VLAs and nested functions
- References: <20090422110650.GC4664@tyan-ft48-01.lab.bos.redhat.com> <email@example.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Apr 22, 2009 at 05:26:03PM +0200, Eric Botcazou wrote:
> > 4) Ada doesn't at least in some cases seem to create outermost BIND_EXPR
> > for functions which references DECL_INITIAL (fndecl) block, so when
> > finalize_nesting_tree_1 calls declare_vars on debug_var_chain (vars
> > that are really never mentioned in the stmts and are only needed for
> > debug info), the variables are recorded just into gimple_bind_vars
> > (and afterwards moved to cfun->local_decls and then dropped as unused),
> > but not into any BLOCK_VARS where it would be actually emitted into
> > debug info.
> Yes, known quirk, I tried to fix it in the gimplifier at some point but this
> was rejected: http://gcc.gnu.org/ml/gcc-patches/2007-02/msg01080.html
> What do you think? Not that I cannot try and fix it in gigi but the problems
> you have described with the gimplifier-created GIMPLE_BIND would stay latent.
If the FE creates the BIND_EXPR, then the gimplifier won't need to add it.
Anyway, the patch I posted cures this issue in tree-nested.c by adding
directly to DECL_INITIAL's BLOCK_VARS, the debug_var_chain vars don't need
to be in local_decls, they are for debug info purposes only.