This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PR86413
- From: Jason Merrill <jason at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Sun, 8 Jul 2018 22:07:43 +1000
- Subject: Re: [PATCH] Fix PR86413
- References: <alpine.LSU.email@example.com>
On Fri, Jul 6, 2018 at 8:14 PM, Richard Biener <firstname.lastname@example.org> wrote:
> The following fixes
> FAIL: gcc.dg/guality/pr48437.c -O2 -flto -fno-use-linker-plugin
> -flto-partition=none line 14 i == 0
> because we now prune non-local/VAR_DECLs from BLOCK trees during
> free-lang-data (after we emitted early dwarf). gen_block_die
> isn't prepared for that and now refuses to add low/high-PC
> attributes to blocks that got all BLOCK_VARS stripped that way.
> The fix is to simply always emit them for early generated DIEs
> (so we only ever elide the DIE creation during early dwarf).
> Note this would allow us to prune BLOCK_VARS completely after
> early dwarf generation (but we need to keep the BLOCK tree itself
> for scoping obviously).
> Bootstrap / regtest running on x86_64-unknown-linux-gnu, ok?
> 2018-07-06 Richard Biener <email@example.com>
> PR debug/86413
> * dwarf2out.c (gen_block_die): For an early generated DIE
> always output high/low PC attributes.
> diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
> index a7c4620cfc3..95232177d83 100644
> --- a/gcc/dwarf2out.c
> +++ b/gcc/dwarf2out.c
> @@ -25622,6 +25622,11 @@ gen_block_die (tree stmt, dw_die_ref context_die)
> /* The outer scopes for inlinings *must* always be represented. We
> generate DW_TAG_inlined_subroutine DIEs for them. (See below.) */
> must_output_die = 1;
> + else if (BLOCK_DIE (stmt))
> + /* If we already have a DIE then it was filled early. Meanwhile
> + we might have pruned all BLOCK_VARS as optimized out but we
> + still want to generate high/low PC attributes so output it. */
> + must_output_die = 1;
> /* Determine if this block directly contains any "significant"