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

--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
I do not think we have problem with -g/without, because abstract origins are
set independently on debugger setting.

Normally callgraph will release function body when it is found unreachable.
This breaks debug info if the function appears as abstract origin, because it
prevents dwarf2out from being able to output its abstract DIE. The flag simply
prevents releasing such function bodies.

I suppose we can drop the test in can_remove_node_now_p_1 but we need to ensure
that all inline clones actually gets the flag set (because we do not know which
one will be last removed from callgraph and triggering the elimination).
This is probably easy to do:
 - clone_inlined_nodes needs to copy the used_as_abstract_origin flag from its
   master
 - symbol_table::remove_unreachable_nodes needs to walk all clones and set
their flag.

Reply via email to