> On Nov 22, 2023, Jan Hubicka <hubi...@ucw.cz> wrote: > > > I wonder why you use same body aliases, which are kind of special to C++ > > frontend (and come with fixup code working around its quirks you had to > > disable above). > > TBH, I don't recall whether I had any reason to have gone down that > path, or I just didn't realize I could have done something simpler. > I've worked on and off on this patch for the past 3.5y, so many details > have faded away from memory by now. I do recall there were some > challenges in making the sym_alias name available as an alias target > early enough for it to be found, and this may have been related with > these odd choices back then. But the good news is that calling > create_alias works just fine. I'm suppose that creating alias > attributes would as well, but why bother? This looks even clearner! > Thanks!
> diff --git a/gcc/cgraphunit.cc b/gcc/cgraphunit.cc > index bccd2f2abb5a3..eb2d05094e989 100644 > --- a/gcc/cgraphunit.cc > +++ b/gcc/cgraphunit.cc > @@ -1175,7 +1175,7 @@ analyze_functions (bool first_time) > C++ FE is confused about the COMDAT groups being right. */ > if (symtab->cpp_implicit_aliases_done) > FOR_EACH_SYMBOL (node) > - if (node->cpp_implicit_alias) > + if (node->cpp_implicit_alias && node->analyzed) I think you hould be able to drop this, since aliases you create now are not same body aliases. > + if (VAR_P (replaced)) > + varpool_node::create_alias (sym_node->decl, replacement); > + else > + cgraph_node::create_alias (sym_node->decl, replacement); We probably chould have create_alias on symbol node directly, but that is something I can clean up next stage1. The IPA bits are fine. I will take a look on your second patch. Honza