[PATCH]: Trying to make list nodes smaller, but the C++ FE keeps beating me down

Daniel Berlin dberlin@dberlin.org
Sun May 15 03:42:00 GMT 2005


The attached patch works fine for C, Java, and F95, AFAICT (it
bootstraps and passes regtests ).

It removes the TREE_TYPE field from TREE_LIST, which is not used in
these FE's (it's a first step to actually removing all but the purpose
and value fields for TREE_LIST and STATEMENT_LIST_NODE, which would
bring TREE_LIST from 28 bytes to 8 or 12 on a 32 bit machine).

Unfortunately, the C++ FE seems to like to reuse TREE_TYPE for it's own
evil purposes on TREE_LIST, in various ways.

It seemed a bit silly to require everyone to have these fields and flags
simply because the C++ FE needs them, though it seems even weirder that
the C++ FE didn't just add new tree codes and tree structures instead of
doing things like:

#define TINFO_VTABLE_DECL(NODE) TREE_VALUE (NODE) 
#define TINFO_REAL_NAME(NODE) TREE_PURPOSE (NODE)

However, as a first stage, i figured i would just add a tree_list with a
type field for the C++ FE, until others get around to doing such a
thing.

So i added TREE_LIST_WT (WT = With type) for the C++ FE, and was
converting all the users over, but it appears there is magic in here
that i don't understand that is checking in various places.  I don't
understand where and when TREE_LIST is supposed to appear in the C++ FE,
and when we expect TREE_TYPE to be valid in it. 

I've attached the patch so far, as well as the test i was using (which
is one of the STL tests)

I'd appreciate if some C++ FE person could give me a hand here so we can
reduce the memory usage of our compiler :)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: listnode.diff
Type: text/x-patch
Size: 23733 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20050515/55ad0dd8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 14340.ii.gz
Type: application/x-gzip
Size: 103672 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20050515/55ad0dd8/attachment-0001.bin>


More information about the Gcc-patches mailing list