diff options
author | Richard Biener <rguenther@suse.de> | 2020-01-20 10:36:09 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2020-01-20 12:56:43 +0100 |
commit | 991b91497fd50f6e70e5f2c0cfa96e1b74157bdc (patch) | |
tree | c3ca6b40e715fc26295a664e2ac29e2492217bbb /gcc/dwarf2out.c | |
parent | 24b178184f260a6ec1516cfb8bb8876874a078a7 (diff) | |
download | gcc-991b91497fd50f6e70e5f2c0cfa96e1b74157bdc.zip gcc-991b91497fd50f6e70e5f2c0cfa96e1b74157bdc.tar.gz gcc-991b91497fd50f6e70e5f2c0cfa96e1b74157bdc.tar.bz2 |
debug/92763 keep DIEs that might be used in DW_TAG_inlined_subroutine
We were pruning type-local subroutine DIEs if their context is unused
despite us later needing those DIEs as abstract origins for inlines.
The patch makes code already present for -fvar-tracking-assignments
unconditional.
2020-01-20 Richard Biener <rguenther@suse.de>
PR debug/92763
* dwarf2out.c (prune_unused_types): Unconditionally mark
called function DIEs.
* g++.dg/debug/pr92763.C: New testcase.
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 70b3fad..fe46c7e 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -29529,9 +29529,9 @@ prune_unused_types (void) for (i = 0; base_types.iterate (i, &base_type); i++) prune_unused_types_mark (base_type, 1); - /* For -fvar-tracking-assignments, also set the mark on nodes that could be - referenced by DW_TAG_call_site DW_AT_call_origin (i.e. direct call - callees). */ + /* Also set the mark on nodes that could be referenced by + DW_TAG_call_site DW_AT_call_origin (i.e. direct call callees) or + by DW_TAG_inlined_subroutine origins. */ cgraph_node *cnode; FOR_EACH_FUNCTION (cnode) if (cnode->referred_to_p (false)) @@ -29540,8 +29540,7 @@ prune_unused_types (void) if (die == NULL || die->die_mark) continue; for (cgraph_edge *e = cnode->callers; e; e = e->next_caller) - if (e->caller != cnode - && opt_for_fn (e->caller->decl, flag_var_tracking_assignments)) + if (e->caller != cnode) { prune_unused_types_mark (die, 1); break; |