This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Subject: Removing the arg_index field from cpp_hashnode
Zack Weinberg wrote:
The really gaping space waste in IDENTIFIER_NODEs is most of struct
tree_common (20 bytes of which only a few of the flag bits are
actually used for something); however, that's very hard to fix.
I have some other ideas for IDENTIFIER_NODE, but they are orthogonal,
and I'll bring them on individually.
I only count 12 bytes for tree_common (on a 32-bit machine), unless
there is some memory allocation overhead.
I'm not sure what good you think it will do to get rid of the rid_code
field. In principle, the same identifier might simultaneously be a
language keyword (rid_code), directive name (directive_index), and
macro parameter name (arg_index) -- e.g., "if".
Well, the rid_code (reserved word) and IDENTIFIER_LOCAL_VALUE
(non-reserved identifier) are mutually exclusive, so for example
we can put them both in the same union. For example.
; there is no way to
get rid of the type and flags fields that I can see;
The 'type' flag as far as I can see only needs two bits. The flags
fields can perhaps be combined with the flags in tree_common, though
that is harder.
and you'd only
save more space if you somehow got rid of all four of the 8-bit fields
(and then only on 32-bit systems).
Yes, saving another word is harder, and may require more radical
changes. We can save a number of fields in lang_ident, but I'll
get to that in a later message.
But let's start with arg_index.
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/