On Thu, 2025-12-04 at 14:53:08 +0100, Jan Hubicka wrote:
>
> > ref_by_asm will be used by toplevel assembly to mark symbols that cannot
> > be removed.
> > It largely overlaps with force_output. Main difference is that ref_by_asm
> > is meaningful on declarations by not removing them. force_output with
> > declaration is ignored, which cannot be easily changed, since several
> > places depend on this behavior.
>
> What places depends on this?
trans-mem.cc, fixable
ipa-visibility.cc with:
/* Frontends and alias code marks nodes as needed before parsing
is finished. We may end up marking as node external nodes
where this flag is meaningless strip it. */
if (DECL_EXTERNAL (node->decl) || !node->definition)
{
node->force_output = 0;
node->forced_by_abi = 0;
}
We could remove this and unify with ref_by_asm, but that would
fail test from PR debug/26965 (unnecessary debug info), because
we would keep some unused declarations with meaningless force_output.
Michal