This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tree-ssa] Put CFG into GGC memory


Hi,
As discussed earlier this patch makes whole CFG datastructure to live in
GGC instead of allocpools.  To my surprise this does not appear to have
large compilation time costs as we either have relatively small CFG (as
in Gerald's testcase) or very large (Brad's testcases) but mostly
unchanging during the compilation, so we produce very little additional
garbage.
I've kept ggc_free calls commented out.

2003-12-01  Jan Hubicka  <jh@suse.cz>
	* Makefile.in (function.o, reg-stack.o): Add missing dependency on
	basic-block.h
	(GTFILES): Add basic-block.h and hwint.h
	* basic-block.h (struct edge_def, struct basic_block_def): Add GTY markders
	(ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR): Change from macro to variable
	(entry_exit_blocks): Kill.
	* cfg.c: Include ggc.h
	(bb_pool, edge_pool, entry_exit_blocks): Kill.
	(ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR): Define.
	(init_flow): Do not create ppols; allocate entry/exit block.
	(free_edge, alloc_block, expunge_block, unchecked_make_edge): Use GGC
	* cfgrtl.c (rtl_merge_blocks): Clear head pointer.
	* gengtype-lex.l (IWOrD): Add HOST_WIDEST_INT
	* tree-cfg.c (obstack_tree_ann_obstack, first_block_tree_and_obj): Kill.
	(create_block_annotations): Do not initialize obstack.
	(free_block_annotations): Do not free obstack.
	(create_block_annotation): Use GGC.
	* tree-flow.h (bb_ann, bb_ann_d): Declare.
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.903.2.147
diff -c -3 -p -r1.903.2.147 Makefile.in
*** Makefile.in	1 Dec 2003 19:38:19 -0000	1.903.2.147
--- Makefile.in	1 Dec 2003 23:27:31 -0000
*************** varasm.o : varasm.c $(CONFIG_H) $(SYSTEM
*** 1675,1681 ****
  function.o : function.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
     flags.h function.h $(EXPR_H) $(OPTABS_H) libfuncs.h $(REGS_H) hard-reg-set.h \
     insn-config.h $(RECOG_H) output.h toplev.h except.h $(HASHTAB_H) $(GGC_H) \
!    $(TM_P_H) langhooks.h gt-function.h $(TARGET_H)
  stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) flags.h \
     function.h insn-config.h hard-reg-set.h $(EXPR_H) libfuncs.h except.h \
     $(LOOP_H) $(RECOG_H) toplev.h output.h varray.h $(GGC_H) $(TM_P_H) \
--- 1675,1681 ----
  function.o : function.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
     flags.h function.h $(EXPR_H) $(OPTABS_H) libfuncs.h $(REGS_H) hard-reg-set.h \
     insn-config.h $(RECOG_H) output.h toplev.h except.h $(HASHTAB_H) $(GGC_H) \
!    $(TM_P_H) langhooks.h gt-function.h $(TARGET_H) basic-block.h
  stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) flags.h \
     function.h insn-config.h hard-reg-set.h $(EXPR_H) libfuncs.h except.h \
     $(LOOP_H) $(RECOG_H) toplev.h output.h varray.h $(GGC_H) $(TM_P_H) \
*************** recog.o : recog.c $(CONFIG_H) $(SYSTEM_H
*** 1935,1941 ****
     $(INSN_ATTR_H) real.h toplev.h output.h reload.h $(TM_P_H)
  reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
     $(RECOG_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h toplev.h reload.h \
!    varray.h function.h $(TM_P_H) $(GGC_H) gt-reg-stack.h
  sreal.o: sreal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) sreal.h
  predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
     flags.h insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
--- 1935,1941 ----
     $(INSN_ATTR_H) real.h toplev.h output.h reload.h $(TM_P_H)
  reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
     $(RECOG_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h toplev.h reload.h \
!    varray.h function.h $(TM_P_H) $(GGC_H) gt-reg-stack.h basic-block.h
  sreal.o: sreal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) sreal.h
  predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
     flags.h insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
*************** GTFILES = $(srcdir)/input.h $(srcdir)/co
*** 2186,2194 ****
    $(host_xm_file_list) $(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) \
    $(srcdir)/bitmap.h $(srcdir)/coverage.c $(srcdir)/function.h  $(srcdir)/rtl.h \
    $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/libfuncs.h $(srcdir)/hashtable.h \
!   $(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/insn-addr.h \
    $(srcdir)/cselib.h $(srcdir)/basic-block.h  $(srcdir)/cgraph.h \
!   $(srcdir)/c-common.h $(srcdir)/c-tree.h \
    $(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \
    $(srcdir)/dependence.c  \
    $(srcdir)/dbxout.c $(srcdir)/dwarf2out.c $(srcdir)/dwarf2asm.c \
--- 2186,2194 ----
    $(host_xm_file_list) $(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) \
    $(srcdir)/bitmap.h $(srcdir)/coverage.c $(srcdir)/function.h  $(srcdir)/rtl.h \
    $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/libfuncs.h $(srcdir)/hashtable.h \
!   $(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/insn-addr.h $(srcdir)/hwint.h \
    $(srcdir)/cselib.h $(srcdir)/basic-block.h  $(srcdir)/cgraph.h \
!   $(srcdir)/c-common.h $(srcdir)/c-tree.h $(srcdir)/basic-block.h \
    $(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \
    $(srcdir)/dependence.c  \
    $(srcdir)/dbxout.c $(srcdir)/dwarf2out.c $(srcdir)/dwarf2asm.c \
Index: basic-block.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/basic-block.h,v
retrieving revision 1.153.2.37
diff -c -3 -p -r1.153.2.37 basic-block.h
*** basic-block.h	1 Dec 2003 22:30:48 -0000	1.153.2.37
--- basic-block.h	1 Dec 2003 23:27:31 -0000
*************** do {									\
*** 121,147 ****
  typedef HOST_WIDEST_INT gcov_type;
  
  /* Control flow edge information.  */
! typedef struct edge_def {
    /* Links through the predecessor and successor lists.  */
!   struct edge_def *pred_next, *succ_next;
  
    /* The two blocks at the ends of the edge.  */
!   struct basic_block_def *src, *dest;
  
    /* Instructions queued on the edge.  */
!   union {
      rtx r;
      tree t;
!   } insns;
  
    /* Auxiliary info specific to a pass.  */
!   void *aux;
  
    int flags;			/* see EDGE_* below  */
    int probability;		/* biased by REG_BR_PROB_BASE */
    gcov_type count;		/* Expected number of executions calculated
  				   in profile.c  */
! } *edge;
  
  #define EDGE_FALLTHRU		1	/* 'Straight line' flow */
  #define EDGE_ABNORMAL		2	/* Strange flow, like computed
--- 121,152 ----
  typedef HOST_WIDEST_INT gcov_type;
  
  /* Control flow edge information.  */
! struct edge_def GTY((chain_next ("%h.pred_next")))
! {
    /* Links through the predecessor and successor lists.  */
!   struct edge_def *pred_next;
!   struct edge_def *succ_next;
  
    /* The two blocks at the ends of the edge.  */
!   struct basic_block_def *src;
!   struct basic_block_def *dest;
  
    /* Instructions queued on the edge.  */
!   union edge_def_insns {
      rtx r;
      tree t;
!   } GTY ((skip (""))) insns;
  
    /* Auxiliary info specific to a pass.  */
!   PTR GTY ((skip (""))) aux;
  
    int flags;			/* see EDGE_* below  */
    int probability;		/* biased by REG_BR_PROB_BASE */
    gcov_type count;		/* Expected number of executions calculated
  				   in profile.c  */
! };
! 
! typedef struct edge_def *edge;
  
  #define EDGE_FALLTHRU		1	/* 'Straight line' flow */
  #define EDGE_ABNORMAL		2	/* Strange flow, like computed
*************** struct bb_ann_d;
*** 203,249 ****
     basic blocks.  */
  
  /* Basic block information indexed by block number.  */
! typedef struct basic_block_def {
    /* The first and last insns of the block.  */
!   rtx head, end;
  
    /* Pointers to the first and last trees of the block.  */
    tree stmt_list;
  
    /* The edges into and out of the block.  */
!   edge pred, succ;
  
    /* Liveness info.  */
  
    /* The registers that are modified within this in block.  */
!   regset local_set;
    /* The registers that are conditionally modified within this block.
       In other words, registers that are set only as part of a
       COND_EXEC.  */
!   regset cond_local_set;
    /* The registers that are live on entry to this block.
  
       Note that in SSA form, global_live_at_start does not reflect the
       use of regs in phi functions, since the liveness of these regs
       may depend on which edge was taken into the block.  */
!   regset global_live_at_start;
    /* The registers that are live on exit from this block.  */
!   regset global_live_at_end;
  
    /* Auxiliary info specific to a pass.  */
!   void *aux;
  
    /* The index of this block.  */
    int index;
  
    /* Previous and next blocks in the chain.  */
!   struct basic_block_def *prev_bb, *next_bb;
  
    /* The loop depth of this block.  */
    int loop_depth;
  
    /* Innermost loop containing the block.  */
!   struct loop *loop_father;
  
    /* Expected number of executions: calculated in profile.c.  */
    gcov_type count;
--- 208,258 ----
     basic blocks.  */
  
  /* Basic block information indexed by block number.  */
! struct basic_block_def GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb")))
! {
    /* The first and last insns of the block.  */
!   rtx head;
!   rtx end;
  
    /* Pointers to the first and last trees of the block.  */
    tree stmt_list;
  
    /* The edges into and out of the block.  */
!   edge pred;
!   edge succ;
  
    /* Liveness info.  */
  
    /* The registers that are modified within this in block.  */
!   bitmap GTY ((skip (""))) local_set;
    /* The registers that are conditionally modified within this block.
       In other words, registers that are set only as part of a
       COND_EXEC.  */
!   bitmap GTY ((skip (""))) cond_local_set;
    /* The registers that are live on entry to this block.
  
       Note that in SSA form, global_live_at_start does not reflect the
       use of regs in phi functions, since the liveness of these regs
       may depend on which edge was taken into the block.  */
!   bitmap GTY ((skip (""))) global_live_at_start;
    /* The registers that are live on exit from this block.  */
!   bitmap GTY ((skip (""))) global_live_at_end;
  
    /* Auxiliary info specific to a pass.  */
!   PTR GTY ((skip (""))) aux;
  
    /* The index of this block.  */
    int index;
  
    /* Previous and next blocks in the chain.  */
!   struct basic_block_def *prev_bb;
!   struct basic_block_def *next_bb;
  
    /* The loop depth of this block.  */
    int loop_depth;
  
    /* Innermost loop containing the block.  */
!   struct loop * GTY ((skip (""))) loop_father;
  
    /* Expected number of executions: calculated in profile.c.  */
    gcov_type count;
*************** typedef struct basic_block_def {
*** 255,265 ****
    int flags;
  
    /* Additional data maintained by cfg_layout routines.  */
!   struct reorder_block_def *rbi;
  
    /* Annotations used at the tree level.  */
    struct bb_ann_d *tree_annotations;
! } *basic_block;
  
  #define BB_FREQ_MAX 10000
  
--- 264,276 ----
    int flags;
  
    /* Additional data maintained by cfg_layout routines.  */
!   struct reorder_block_def * GTY ((skip (""))) rbi;
  
    /* Annotations used at the tree level.  */
    struct bb_ann_d *tree_annotations;
! };
! 
! typedef struct basic_block_def *basic_block;
  
  #define BB_FREQ_MAX 10000
  
*************** extern struct obstack flow_obstack;
*** 346,354 ****
  #define INVALID_BLOCK (-3)
  
  /* Similarly, block pointers for the edge list.  */
! extern struct basic_block_def entry_exit_blocks[2];
! #define ENTRY_BLOCK_PTR	(&entry_exit_blocks[0])
! #define EXIT_BLOCK_PTR	(&entry_exit_blocks[1])
  
  #define BLOCK_NUM(INSN)	      (BLOCK_FOR_INSN (INSN)->index + 0)
  #define set_block_for_insn(INSN, BB)  (BLOCK_FOR_INSN (INSN) = BB)
--- 357,364 ----
  #define INVALID_BLOCK (-3)
  
  /* Similarly, block pointers for the edge list.  */
! extern GTY(()) basic_block ENTRY_BLOCK_PTR;
! extern GTY(()) basic_block EXIT_BLOCK_PTR;
  
  #define BLOCK_NUM(INSN)	      (BLOCK_FOR_INSN (INSN)->index + 0)
  #define set_block_for_insn(INSN, BB)  (BLOCK_FOR_INSN (INSN) = BB)
Index: cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfg.c,v
retrieving revision 1.34.2.17
diff -c -3 -p -r1.34.2.17 cfg.c
*** cfg.c	1 Dec 2003 22:30:48 -0000	1.34.2.17
--- cfg.c	1 Dec 2003 23:27:31 -0000
*************** Software Foundation, 59 Temple Place - S
*** 62,81 ****
  #include "tm_p.h"
  #include "obstack.h"
  #include "alloc-pool.h"
  
  /* The obstack on which the flow graph components are allocated.  */
  
  struct obstack flow_obstack;
  static char *flow_firstobj;
  
- /* Basic block object pool.  */
- 
- static alloc_pool bb_pool;
- 
- /* Edge object pool.  */
- 
- static alloc_pool edge_pool;
- 
  /* Number of basic blocks in the current function.  */
  
  int n_basic_blocks;
--- 62,74 ----
  #include "tm_p.h"
  #include "obstack.h"
  #include "alloc-pool.h"
+ #include "ggc.h"
  
  /* The obstack on which the flow graph components are allocated.  */
  
  struct obstack flow_obstack;
  static char *flow_firstobj;
  
  /* Number of basic blocks in the current function.  */
  
  int n_basic_blocks;
*************** int n_edges;
*** 93,144 ****
  varray_type basic_block_info;
  
  /* The special entry and exit blocks.  */
! 
! struct basic_block_def entry_exit_blocks[2]
! = {{NULL,			/* head */
!     NULL,			/* end */
!     NULL,			/* stmt_list*/
!     NULL,			/* pred */
!     NULL,			/* succ */
!     NULL,			/* local_set */
!     NULL,			/* cond_local_set */
!     NULL,			/* global_live_at_start */
!     NULL,			/* global_live_at_end */
!     NULL,			/* aux */
!     ENTRY_BLOCK,		/* index */
!     NULL,			/* prev_bb */
!     EXIT_BLOCK_PTR,		/* next_bb */
!     0,				/* loop_depth */
!     NULL,                       /* loop_father */
!     0,				/* count */
!     0,				/* frequency */
!     0,				/* flags */
!     NULL,			/* rbi */
!     NULL                        /* tree_annotations */
!   },
!   {
!     NULL,			/* head */
!     NULL,			/* end */
!     NULL,			/* stmt_list */
!     NULL,			/* pred */
!     NULL,			/* succ */
!     NULL,			/* local_set */
!     NULL,			/* cond_local_set */
!     NULL,			/* global_live_at_start */
!     NULL,			/* global_live_at_end */
!     NULL,			/* aux */
!     EXIT_BLOCK,			/* index */
!     ENTRY_BLOCK_PTR,		/* prev_bb */
!     NULL,			/* next_bb */
!     0,				/* loop_depth */
!     NULL,                       /* loop_father */
!     0,				/* count */
!     0,				/* frequency */
!     0,				/* flags */
!     NULL,			/* rbi */
!     NULL                        /* tree_annotations */
!   }
! };
  
  void debug_flow_info (void);
  static void free_edge (edge);
--- 86,92 ----
  varray_type basic_block_info;
  
  /* The special entry and exit blocks.  */
! basic_block ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR;
  
  void debug_flow_info (void);
  static void free_edge (edge);
*************** init_flow (void)
*** 160,184 ****
      }
    else
      {
-       free_alloc_pool (bb_pool);
-       free_alloc_pool (edge_pool);
        obstack_free (&flow_obstack, flow_firstobj);
        flow_firstobj = obstack_alloc (&flow_obstack, 0);
      }
!   bb_pool = create_alloc_pool ("Basic block pool",
! 			       sizeof (struct basic_block_def), 100);
!   edge_pool = create_alloc_pool ("Edge pool",
! 			       sizeof (struct edge_def), 100);
  }
  
  /* Helper function for remove_edge and clear_edges.  Frees edge structure
     without actually unlinking it from the pred/succ lists.  */
  
  static void
! free_edge (edge e)
  {
    n_edges--;
!   pool_free (edge_pool, e);
  }
  
  /* Free the memory associated with the edge structures.  */
--- 108,133 ----
      }
    else
      {
        obstack_free (&flow_obstack, flow_firstobj);
        flow_firstobj = obstack_alloc (&flow_obstack, 0);
      }
! 
!   ENTRY_BLOCK_PTR = ggc_alloc_cleared (sizeof (*ENTRY_BLOCK_PTR));
!   ENTRY_BLOCK_PTR->index = ENTRY_BLOCK;
!   EXIT_BLOCK_PTR = ggc_alloc_cleared (sizeof (*EXIT_BLOCK_PTR));
!   EXIT_BLOCK_PTR->index = EXIT_BLOCK;
!   ENTRY_BLOCK_PTR->next_bb = EXIT_BLOCK_PTR;
!   EXIT_BLOCK_PTR->prev_bb = ENTRY_BLOCK_PTR;
  }
  
  /* Helper function for remove_edge and clear_edges.  Frees edge structure
     without actually unlinking it from the pred/succ lists.  */
  
  static void
! free_edge (edge e ATTRIBUTE_UNUSED)
  {
    n_edges--;
!   /* ggc_free (e);  */
  }
  
  /* Free the memory associated with the edge structures.  */
*************** basic_block
*** 227,234 ****
  alloc_block (void)
  {
    basic_block bb;
!   bb = pool_alloc (bb_pool);
!   memset (bb, 0, sizeof (*bb));
    return bb;
  }
  
--- 176,182 ----
  alloc_block (void)
  {
    basic_block bb;
!   bb = ggc_alloc_cleared (sizeof (*bb));
    return bb;
  }
  
*************** expunge_block (basic_block b)
*** 300,306 ****
    unlink_block (b);
    BASIC_BLOCK (b->index) = NULL;
    n_basic_blocks--;
!   pool_free (bb_pool, b);
  }
  
  /* Create an edge connecting SRC and DEST with flags FLAGS.  Return newly
--- 248,254 ----
    unlink_block (b);
    BASIC_BLOCK (b->index) = NULL;
    n_basic_blocks--;
!   /* ggc_free (b); */
  }
  
  /* Create an edge connecting SRC and DEST with flags FLAGS.  Return newly
*************** edge
*** 311,318 ****
  unchecked_make_edge (basic_block src, basic_block dst, int flags)
  {
    edge e;
!   e = pool_alloc (edge_pool);
!   memset (e, 0, sizeof (*e));
    n_edges++;
  
    e->succ_next = src->succ;
--- 259,265 ----
  unchecked_make_edge (basic_block src, basic_block dst, int flags)
  {
    edge e;
!   e = ggc_alloc_cleared (sizeof (*e));
    n_edges++;
  
    e->succ_next = src->succ;
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v
retrieving revision 1.57.2.19
diff -c -3 -p -r1.57.2.19 cfgrtl.c
*** cfgrtl.c	14 Nov 2003 00:24:28 -0000	1.57.2.19
--- cfgrtl.c	1 Dec 2003 23:27:32 -0000
*************** rtl_merge_blocks (basic_block a, basic_b
*** 623,633 ****
    else if (GET_CODE (NEXT_INSN (a_end)) == BARRIER)
      del_first = NEXT_INSN (a_end);
  
-   update_cfg_after_block_merging (a, b);
- 
    /* Delete everything marked above as well as crap that might be
       hanging out between the two blocks.  */
    delete_insn_chain (del_first, del_last);
  
    /* Reassociate the insns of B with A.  */
    if (!b_empty)
--- 623,634 ----
    else if (GET_CODE (NEXT_INSN (a_end)) == BARRIER)
      del_first = NEXT_INSN (a_end);
  
    /* Delete everything marked above as well as crap that might be
       hanging out between the two blocks.  */
+   b->head = NULL;
    delete_insn_chain (del_first, del_last);
+ 
+   update_cfg_after_block_merging (a, b);
  
    /* Reassociate the insns of B with A.  */
    if (!b_empty)
Index: gengtype-lex.l
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gengtype-lex.l,v
retrieving revision 1.5.6.10
diff -c -3 -p -r1.5.6.10 gengtype-lex.l
*** gengtype-lex.l	18 Oct 2003 23:59:46 -0000	1.5.6.10
--- gengtype-lex.l	1 Dec 2003 23:27:32 -0000
*************** update_lineno (const char *l, size_t len
*** 47,53 ****
  
  ID	[[:alpha:]_][[:alnum:]_]*
  WS	[[:space:]]+
! IWORD	short|long|(un)?signed|char|int|HOST_WIDE_INT|bool|size_t|CHAR_BITFIELD
  ITYPE	{IWORD}({WS}{IWORD})*
  
  %x in_struct in_struct_comment in_comment in_yacc_escape
--- 47,53 ----
  
  ID	[[:alpha:]_][[:alnum:]_]*
  WS	[[:space:]]+
! IWORD	short|long|(un)?signed|char|int|HOST_WIDE_INT|HOST_WIDEST_INT|bool|size_t|CHAR_BITFIELD
  ITYPE	{IWORD}({WS}{IWORD})*
  
  %x in_struct in_struct_comment in_comment in_yacc_escape
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-cfg.c,v
retrieving revision 1.1.4.226
diff -c -3 -p -r1.1.4.226 tree-cfg.c
*** tree-cfg.c	1 Dec 2003 22:30:48 -0000	1.1.4.226
--- tree-cfg.c	1 Dec 2003 23:27:33 -0000
*************** static dominance_info pdom_info = NULL;
*** 69,77 ****
  
  static struct cfg_stats_d cfg_stats;
  
- static struct obstack block_tree_ann_obstack;
- static void *first_block_tree_ann_obj = 0;
- 
  /* Nonzero if we found a computed goto while building basic blocks.  */
  static bool found_computed_goto;
  
--- 69,74 ----
*************** factor_computed_gotos (void)
*** 304,321 ****
  static void create_blocks_annotations (void)
  {
    basic_block bb;
-   static int initialized;
- 
-   if (!initialized)
-     {
-       gcc_obstack_init (&block_tree_ann_obstack);
-       initialized = 1;
-     }
-   /* Check whether TREE_ANNOTATIONS data are still allocated.  */
-   else if (first_block_tree_ann_obj)
-     abort ();
-   
-   first_block_tree_ann_obj = obstack_alloc (&block_tree_ann_obstack, 0);
    
    FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
      create_block_annotation (bb);
--- 301,306 ----
*************** static void create_blocks_annotations (v
*** 326,347 ****
  static void create_block_annotation (basic_block bb)
  {
    /* Verify that the tree_annotations field is clear.  */
!   if (bb->tree_annotations || !first_block_tree_ann_obj)
      abort ();
!   bb->tree_annotations = obstack_alloc (&block_tree_ann_obstack, 
! 					sizeof (struct bb_ann_d));
!   memset (bb->tree_annotations, 0, sizeof (struct bb_ann_d));
  }
  
  /* Free the annotations for all the basic blocks.  */
  
  static void free_blocks_annotations (void)
  {
-   if (!first_block_tree_ann_obj)
-     abort ();
-   obstack_free (&block_tree_ann_obstack, first_block_tree_ann_obj);
-   first_block_tree_ann_obj = NULL;
- 
    clear_blocks_annotations ();  
  }
  
--- 311,325 ----
  static void create_block_annotation (basic_block bb)
  {
    /* Verify that the tree_annotations field is clear.  */
!   if (bb->tree_annotations)
      abort ();
!   bb->tree_annotations = ggc_alloc_cleared (sizeof (struct bb_ann_d));
  }
  
  /* Free the annotations for all the basic blocks.  */
  
  static void free_blocks_annotations (void)
  {
    clear_blocks_annotations ();  
  }
  
Index: tree-flow.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-flow.h,v
retrieving revision 1.1.4.161
diff -c -3 -p -r1.1.4.161 tree-flow.h
*** tree-flow.h	1 Dec 2003 22:30:49 -0000	1.1.4.161
--- tree-flow.h	1 Dec 2003 23:27:33 -0000
*************** static inline tree default_def (tree);
*** 303,309 ****
  /*---------------------------------------------------------------------------
  		  Block annotations stored in basic_block.tree_annotations
  ---------------------------------------------------------------------------*/
! struct bb_ann_d
  {
    /* Chain of EPHI nodes created in this block.  */
    tree ephi_nodes;
--- 303,309 ----
  /*---------------------------------------------------------------------------
  		  Block annotations stored in basic_block.tree_annotations
  ---------------------------------------------------------------------------*/
! struct bb_ann_d GTY(())
  {
    /* Chain of EPHI nodes created in this block.  */
    tree ephi_nodes;
*************** struct bb_ann_d
*** 313,319 ****
    int num_preds;
  
    /* Set of blocks immediately dominated by this node.  */
!   bitmap dom_children;
  
    /* Nonzero if this block is forwardable during cfg cleanups.  This is also
       used to detect loops during cfg cleanups.  */
--- 313,319 ----
    int num_preds;
  
    /* Set of blocks immediately dominated by this node.  */
!   bitmap GTY ((skip (""))) dom_children;
  
    /* Nonzero if this block is forwardable during cfg cleanups.  This is also
       used to detect loops during cfg cleanups.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]