This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Allow cgraph nodes to change name
> Jan Hubicka <hubicka@ucw.cz> writes:
>
> > Hi,
> > in hammer branch we run into testcase where function name changes in the
> > middle of process totally messing up the cgraph hashtables. The
> > testcase does not reproduce on mainline as the function is no longer
> > localized, but I guess the problem remains. The attached patch fixes
> > it. OK?
> >
> > Mon Aug 18 10:12:57 CEST 2003 Jan Hubicka <jh@suse.cz>
> > * cgraph.c (cgraph_set_decl_assembler_name): New function.
> > * cgraph.h (cgraph_set_decl_assembler_name): Declare.
> > * varasm.c (make_decl_rtl): Use it.
>
> I think a better approach would be to ensure that function's assembler
> names are set exactly once, rather than being set (to the wrong value)
> and then changed later. I fixed a bunch of places where this was done
> recently, and so far as I know this is the last place.
It may be also possible to simply produce RTL name before we insert the
node, but I was under impression that for C++ it is expensive to produce
it and that is why we do so lazily on demand.
Honza