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: [trunk][patch] Don't print warnings in mangle_decl


> The problem with this approach -- which is exactly what I suggested --
> is that it's going to cause us to generate mangled names for every
> variable, even ones where we don't need the mangled name. ÂAnd we worked
> pretty hard a while back to try to make mangling lazy, because
> allocating all the memory for mangled names made the compiler a lot slower.

For every variable? I don't think so. The new uses of
DECL_ASSEMBLER_NAME were placed close to where the C++ FE handles data
to the ME. For example, I am almost sure that we don't produce a
warning for unused external variables.

The call to warning that is responsible for template instantiation has
to stay close to where it is. The FE uses some global variables to
decide if it should print the "instantiated from" info.

The other call to warning can probably be moved somewhere else and
replaced with warning_at.

> So, what do we do? ÂI'd like this to be lazy. ÂBut, that means that
> we're going to generate mangled names somewhere late in the game, maybe
> when generating GENERIC. ÂAnd that's not at a predictable place in the
> front end, which is what you were looking for so that we could do nice
> error generation. ÂI don't see how we can have both of laziness and
> errors at the point of declaration.

We can benchmark it :-)
Do you remember which tests benefited the most from using lazy mangling?

Also remember that for LTO we really have to compute all assembly
names of things we write to disk. This is not as early as in this
patch, but I don't think we drop all that many DECLs  in between.

> Jason, what do you think? ÂWhat's the right tradeoff here?
>
> Thanks,
>
> --
> Mark Mitchell
> CodeSourcery
> mark@codesourcery.com
> (650) 331-3385 x713
>


Cheers,
-- 
Rafael Avila de Espindola

Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047


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