public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Shrink tree_block
Date: Sat, 24 Nov 2007 23:31:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.0711241951161.4148@zhemvz.fhfr.qr> (raw)


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.  */

             reply	other threads:[~2007-11-24 18:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-24 23:31 Richard Guenther [this message]
2007-11-24 23:33 ` Andrew Pinski
2007-11-25 19:18   ` Richard Guenther

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0711241951161.4148@zhemvz.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).