diff options
author | Richard Biener <rguenther@suse.de> | 2018-07-12 12:32:30 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2018-07-12 12:32:30 +0000 |
commit | 4405d067adffd5b0d5e0099596fa33e5506d68c8 (patch) | |
tree | 8b7790d8e9a2b4643d883eda9156a22239b0b9cf /gcc/dwarf2out.c | |
parent | 42d406b9df2f2835789598ca5303e2673c73150d (diff) | |
download | gcc-4405d067adffd5b0d5e0099596fa33e5506d68c8.zip gcc-4405d067adffd5b0d5e0099596fa33e5506d68c8.tar.gz gcc-4405d067adffd5b0d5e0099596fa33e5506d68c8.tar.bz2 |
re PR debug/86462 (Quite huge debug info size increase introduced in r262511)
2018-07-12 Richard Biener <rguenther@suse.de>
PR debug/86462
* dwarf2out.c (gen_block_die): Only output blocks when they have
at least one !DECL_IGNORED_P variable.
From-SVN: r262583
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 1127713..c2422e2 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -25627,22 +25627,28 @@ gen_block_die (tree stmt, dw_die_ref context_die) 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; - else + else if (TREE_USED (stmt) + || TREE_ASM_WRITTEN (stmt) + || BLOCK_ABSTRACT (stmt)) { /* Determine if this block directly contains any "significant" local declarations which we will need to output DIEs for. */ if (debug_info_level > DINFO_LEVEL_TERSE) - /* We are not in terse mode so *any* local declaration counts - as being a "significant" one. */ - must_output_die = ((BLOCK_VARS (stmt) != NULL - || BLOCK_NUM_NONLOCALIZED_VARS (stmt)) - && (TREE_USED (stmt) - || TREE_ASM_WRITTEN (stmt) - || BLOCK_ABSTRACT (stmt))); - else if ((TREE_USED (stmt) - || TREE_ASM_WRITTEN (stmt) - || BLOCK_ABSTRACT (stmt)) - && !dwarf2out_ignore_block (stmt)) + { + /* We are not in terse mode so any local declaration that + is not ignored for debug purposes counts as being a + "significant" one. */ + if (BLOCK_NUM_NONLOCALIZED_VARS (stmt)) + must_output_die = 1; + else + for (tree var = BLOCK_VARS (stmt); var; var = DECL_CHAIN (var)) + if (!DECL_IGNORED_P (var)) + { + must_output_die = 1; + break; + } + } + else if (!dwarf2out_ignore_block (stmt)) must_output_die = 1; } |