> 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? Honza > > > I guess it would be most consistent to give up on having the flag up to > > date during cgraph construction (i.e. from finalization time down) and > > compute it during the cgraph_finalize_complation_unit. I will look into > > that. > > Jakub >