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: [C++ PATCH] Kill lang_id2


Steven Bosscher <s.bosscher@student.tudelft.nl> writes:

> Hi,
>
> I don't understand the idea behind lang_id2 in the C++ lang_identifier. 
> The total size of the language identifier is 48 bytes, which puts it in
> a 64 byte bucket for the ggc-page.  Why not just use the extra 16 bytes
> instead of linking to another tree?
>
> Maybe this was a result of the recent name lookup changes?  There is a
> bucket for 44 bytes objects, so if somebody added a field to
> lang_identifier, that would explain.

I'm pretty sure this is historical.  The 44-byte bucket is for
10-field rtl nodes, not C++ lang_identifiers.

> Anyway, I'm testing this patch now.  It would kill a pointer deref, and
> it should save some memory.  OK when it passes bootstrap/regtest?

This is OK.  However:

> !   tree implicit_decl;
> !   tree error_locus;

These fields are never used in correct C++ programs -- there is no
such thing as an implicit declaration in C++, and error_locus is for
only complaining about undeclared variables once per function.  As a
follow-up, please look into removing these fields entirely.  You
should be able to rip out implicit_decl easily; for error_locus, look
at what I did to the analogous code in the C front end.

zw


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