On Wed, Apr 20, 2022 at 11:06:12AM +0200, Jan Hubicka wrote:
> > On Wed, Apr 20, 2022 at 10:45:53AM +0200, Jan Hubicka wrote:
> > > So this change should be unnecessary unless there are nodes that are
> > > missing finalization stage. It also is not good enough since frontends
> > > may change opt_for_fn between node creation and finalization of
> > > compilation unit (so even after cgraph_finalize unforutnately, we had
> > > another bug about that).
> > >
> > > The PR was about implicit C++ alias. So the problem is that aliases
> > > bypass finalization becuase they are produced by
> > > cgraph_node::create_alias that sets definition flag to true.
> >
> > Note, I've already committed the patch as Richi acked it.
> > So, can we move that
> > node->semantic_interposition = opt_for_fn (decl,
> > flag_semantic_interposition);
> > from cgraph_node::create to cgraph_node::create_alias?
>
> I think it would be easiest to move it to the visibility pass
> (after all it is about visibilities and all earlier uses of the flag
> are wrong since frontend is changing it at any time until unit is fully
> built). I will prepare patch tonight or tomorrow.
>
> Also thinking about the copying in cgraph_clone, it would make snese
> only if we produce clones with public linkage. Do we ever do that?
The cgraph.cc change was what I actually needed for the fix, the
cgraphclones.cc was only because I've noticed that it constructs a new
node (so is initialized to whatever random flag_semantic_interposition is
right now) and initializing it to what it is cloned from made more sense.
Jakub