[patch] Do not generate debug info for compiler generated VLAs

Eric Botcazou ebotcazou@adacore.com
Fri Oct 15 09:19:00 GMT 2010


> Hm, it looks sensible, but it's of course odd that if we don't have an
> explicit DECL_IGNORED_P flag (like for a non-type-decl TYPE_NAME
> or for a NULL TYPE_NAME) that we still emit the info.

The C testcase doesn't pass if you don't clear the flag for unnamed types.

> In fact it's odd that the Ada frontend creates a TYPE_DECL for the
> artificial VLAs at all (does it do so only to make this flag available?).

gigi creates a TYPE_DECL for almost every type for internal reasons that are 
related to the global unsharing thing.  Then it uses (an extended version of) 
the TYPE_DECL_IS_STUB trick in dwarf2out.c to avoid emitting DW_TAG_typedef.

> I don't see any better way to deal with this though (other than stealing
> a bit for all types and making sure we do not unify them).  I suppose
> it's not enough to set DECL_IGNORED_P on the VLAs itself?

The check is already for DECL_IGNORED_P on the VLA, not on its TYPE_DOMAIN.

> Anyway, I think that the DECL_IGNORED_P doucmentation in tree.h
> needs to be amended for this special case (like, "For a TYPE_DECL,
> debug information for its type will be as simple as possible." or a
> better wording that I can't come up with right now).

We want no debug info at all for the type though; I think that dwarf2out.c 
already ensures that.

-- 
Eric Botcazou



More information about the Gcc-patches mailing list