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

Richard Guenther richard.guenther@gmail.com
Thu Oct 14 09:31:00 GMT 2010


On Thu, Oct 14, 2010 at 1:16 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Hi,
>
> in February Jakub made a change to the gimplifier in order to generate debug
> info for bounds of VLAs.  This has a significant impact on the code itself in
> Ada (typically +2% code size and +1% compilation time at -O0) because the Ada
> compiler itself generates a lot of VLAs for various constructs; now gigi puts
> DECL_IGNORED_P on these VLAs so the gimplifier shouldn't overrule it.
>
> Bootstrapped/regtested on x86_64-suse-linux, OK for mainline?  What about the
> 4.5 branch?

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

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?

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).

So I'd say, ok for trunk and the branch with the tree.h change.

Thanks,
Richard.

> 2010-10-13  Eric Botcazou  <ebotcazou@adacore.com>
>
>        * gimplify.c (gimplify_type_sizes) <ARRAY_TYPE>: If the type is to be
>        ignored for debug info purposes, do not clear the DECL_IGNORED_P flag
>        on the bounds of its domain.
>
> --
> Eric Botcazou
>



More information about the Gcc-patches mailing list