https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96383

--- Comment #19 from rguenther at suse dot de <rguenther at suse dot de> ---
On Fri, 31 Jul 2020, jakub at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96383
> 
> --- Comment #18 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> (In reply to rguent...@suse.de from comment #17)
> > Well, not sure - FEs do quite a good job with unused warnings by
> > simply tracking things with TREE_USED so I guess global extern decls
> > can be tracked as used/unused as well by FEs and what is a use
> > (and worth emitting debug for) may be better decided by the FE,
> > say for offsetof (X, m) we maybe want debug info for X even if it
> > is not otherwise used?
> 
> Perhaps for C, but for C++ with thousands of inline functions everywhere 
> pretty
> much everything is TREE_USED.

True...

So we could add 
lang_hooks.finalize_fndecl_referenced_from_final_symboltable ()

with the default implementation registering debug for nodes
with bodies and for C/C++ override this to also register debug
for externals?  Not sure if we should hand it the cgraph node
or whether FEs should figure out whether it is an alias or
thunk in their own representation.

Ada could leave it as default or do nothing in it.

We need a better name though.  Not sure if we need to ever do
sth else from that hook and thus make it sepecific for debug
emission...

Reply via email to