This is the mail archive of the 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: [PATCH] Fix up debuginfo for VLAs in nested functions

On Fri, Apr 24, 2009 at 02:51:38PM -0700, Ian Lance Taylor wrote:
> Jakub Jelinek <> writes:
> > One of the changes needed is to honor DECL_BY_REFERENCE even for VAR_DECLs
> > (those which tree-nested.c creates as replacement for
> > PARM_DECLs/RESULT_DECLs).  Unfortunately, ATM DECL_BY_REFERENCE shares the
> > same bit as TREE_PRIVATE.  I believe the C++ FE (the only setter of
> > TREE_PRIVATE) only sets this on FUNCTION_DECLs/FIELD_DECLs and
> > static data members (i.e. TREE_STATIC VAR_DECLs), so this patch extends
> > VAR_DECLs.  Without this parameters passed by invisible reference
> > referenced from nested routines will show up as pointers in the debug info,
> > which is undesirable.
> This overloading will eventually cause a bug if we don't check for it
> when ENABLE_TREE_CHECKING is defined.  Can you, in a separate patch,
> modify TREE_PRIVATE and DECL_BY_REFERENCE to verify that they are being
> invoked appropriately?  Also modify TREE_PROTECTED to check the same set
> of conditions as TREE_PRIVATE.  Then fix any fallout.

Attached is a patch to do that, bootstrapped/regtested on x86_64-linux.

But, I see that tree_decl_common hase 49 unused bits (23 in struct tree_base
and 26 in struct tree_decl_common), so perhaps it is not worth all the
overloading trouble and we could instead just allocate a different bit
for DECL_BY_REFERENCE (this is done in the second patch, also
bootstrapped/regtested on x86_64-linux).

Both patches are incremental, on top of the 3 patches you've ACKed.

Ok for trunk?  Which one?


Attachment: Y300
Description: Text document

Attachment: Y300b
Description: Text document

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