public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Shrink tree_block
@ 2007-11-24 23:31 Richard Guenther
  2007-11-24 23:33 ` Andrew Pinski
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Guenther @ 2007-11-24 23:31 UTC (permalink / raw)
  To: gcc-patches


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;
  };
  \f
  /* 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;
  };
  \f
  /* Define fields and accessors for nodes representing data types.  */

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-25 14:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-24 23:31 [PATCH] Shrink tree_block Richard Guenther
2007-11-24 23:33 ` Andrew Pinski
2007-11-25 19:18   ` Richard Guenther

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).