This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Allow cgraph nodes to change name


Geoff Keating <geoffk@geoffk.org> writes:

>> > 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.
>
> This won't work if the RTL name is wrong.  The problem here is that
> even in C, when you have
>
> extern void foo (void) asm ("bar");
>
> then DECL_ASSEMBLER_NAME starts off by being set to "foo", and then
> later is changed to "bar".  Naturally, this confuses the cgraph code
> (and intermodule analysis, and weak symbols, and everywhere else that
> tries to look at the assembler name).

Probably the best solution is to generate DECL_ASSEMBLER_NAME
extremely lazily or else when forcibly set, as is currently done for
DECL_RTL.

I suspect this works better if unit-at-a-time mode is always on.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]