This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Shrink tree_block
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 24 Nov 2007 19:53:07 +0100 (CET)
- Subject: [PATCH] Shrink tree_block
This shrinks tree_block by noting that with mapped location the
block locus now pairs with the flags. Also blocks do not need
a type and access to the chain member of tree_common is conveniently
wrapped with BLOCK_CHAIN.
So, bootstrapped and tested on x86_64-unknown-linux-gnu, I'll apply
this as a memory-savings regression fix later.
Richard.
2007-11-24 Richard Guenther <rguenther@suse.de>
* tree.h (BLOCK_CHAIN): Use tree_block.chain.
(struct tree_block): Inherit from tree_base, add chain
member. Move locus member next to flags.
Index: tree.h
===================================================================
*** tree.h (revision 130396)
--- tree.h (working copy)
*************** struct varray_head_tag;
*** 2007,2013 ****
#define BLOCK_SUPERCONTEXT(NODE) (BLOCK_CHECK (NODE)->block.supercontext)
/* Note: when changing this, make sure to find the places
that use chainon or nreverse. */
! #define BLOCK_CHAIN(NODE) TREE_CHAIN (BLOCK_CHECK (NODE))
#define BLOCK_ABSTRACT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.abstract_origin)
#define BLOCK_ABSTRACT(NODE) (BLOCK_CHECK (NODE)->block.abstract_flag)
--- 2008,2014 ----
#define BLOCK_SUPERCONTEXT(NODE) (BLOCK_CHECK (NODE)->block.supercontext)
/* Note: when changing this, make sure to find the places
that use chainon or nreverse. */
! #define BLOCK_CHAIN(NODE) (BLOCK_CHECK (NODE)->block.chain)
#define BLOCK_ABSTRACT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.abstract_origin)
#define BLOCK_ABSTRACT(NODE) (BLOCK_CHECK (NODE)->block.abstract_flag)
*************** struct varray_head_tag;
*** 2054,2072 ****
struct tree_block GTY(())
{
! struct tree_common common;
unsigned handler_block_flag : 1;
unsigned abstract_flag : 1;
unsigned block_num : 30;
tree vars;
tree subblocks;
tree supercontext;
tree abstract_origin;
tree fragment_origin;
tree fragment_chain;
- location_t locus;
};
/* Define fields and accessors for nodes representing data types. */
--- 2055,2075 ----
struct tree_block GTY(())
{
! struct tree_base base;
! tree chain;
unsigned handler_block_flag : 1;
unsigned abstract_flag : 1;
unsigned block_num : 30;
+ location_t locus;
+
tree vars;
tree subblocks;
tree supercontext;
tree abstract_origin;
tree fragment_origin;
tree fragment_chain;
};
/* Define fields and accessors for nodes representing data types. */