https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92763
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Richard Biener from comment #3) > So we're inlining A::omp declare reduction > y~i(A::T&)::<lambda()>::operator() (const struct ._anon_1 * const __closure) > which has no abstract origin. > > For the -fno-var-tracking-assignments case we are pruning the early DIE of > the > function as unused as part of prune_unused_types_prune while we don't when > VTA is enabled. That's because: > > /* 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). */ > cgraph_node *cnode; > FOR_EACH_FUNCTION (cnode) > if (cnode->referred_to_p (false)) > { > dw_die_ref die = lookup_decl_die (cnode->decl); > 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)) > { > prune_unused_types_mark (die, 1); > break; > } > } > > I'm not sure why this code shouldn't apply to DW_TAG_inlined_subroutine > which is needed independently of -fvar-tracking-assignments ... I think the reason for the -fvar-tracking-assignments check is, as the comment says, to avoid pruning info that the call site info will need, and the call site info is only emitted if -fvar-tracking-assignments. DW_TAG_call_site is only emitted for the calls that remain as calls in the IL till the end, so if something is inlined, that isn't a call. we do not want