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]

Varrays allocated by xmalloc


Hi,
this patch adds an argument to VARRAY_INIT choosing whether to use
malloc/ggc_alloc memory.  It save roughtly 3% of memory for compiling combine.c
and 5% on Gerald's testcase, I guess it can be more effective on tree-ssa as it
stil use a lot of varrays.

Bootstrapped/regtested i686-pc-gnu-linux. OK.

Honza

2004-02-21  Jan Hubicka  <jh@suse.cz>
	* alias.c (new_alias_set, init_alias_analysis): Update use of
	VARRAY_*INIT.
	* cfglayout.c (insn_locators_initialize): Likewise.
	* cselib.c (cselib_init): Likewise.
	* dwarf2out.c (init_file_table, dwarf2out_init): Likewise.
	* except.c (assign_filter_values, sjlj_assign_call_site_values,
	convert_to_eh_region_ranges): Likewise.
	* function.c (prologue, epilogue, sibcall_prologue): Un GTYize.
	(reorder_blocks): Update use of VARRAY_*INIT.
	(init_function_for_compilation): Likewise.
	* genautomata.c: Likewise.
	* ggc-none.c (ggc_free): New.
	* insn-addr.h (insn_addresses_): Ungtyize.
	(INSN_ADDRESSES_ALLOC, INSN_ADDRESSES_FREE): Use GGC_MALLOC.
	* integrate.c (expand_inline_function): Update use of VARRAY_.*INIT
	* reg-stack.c (reg_to_stack): Likewise.
	* tree-inline.c (optimize_inline_calls): Likewise.
	(clone_body): Likewise.
	* unroll.c (unroll_loop): Likewise.
	* varray.c (struct element): Do not specify allocator.
	(varray_init): Accept allocator.
	(varray_free): New.
	(varray_grow): Use allocator.
	* varray.h (varray_data_tag): Add nonggceed element.
	(varray_init, VARRAY.*_INIT): Add argument.
	(varray_free): Declare.
	(enum varray_allocator): New enum.
	
	* class.c (init_class_processing): Update use of VARRAY_.*INIT.
	(build_vtbl_initializer): Likewise.
	* decl.c (push_local_name): Likewise.
	* decl2.c (finish_static_data_member_decl): Likewise.
	(defer_fn): Likewise.
	(start_static_storage_duration_function): Likewise.
	* mangle.c (start_mangling, finish_mangling): Likewise.
	* name-lookup.c (begin_scope, push_to_top_level): Likewise.
	* parser.c (cp_lexer_new_main): Likewise.
	* pt.c (maybe_begin_member_template_processing): Likewise.
	* rtti.c (init_rtti_processing): Likewise.

Index: alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/alias.c,v
retrieving revision 1.214
diff -c -3 -p -r1.214 alias.c
*** alias.c	3 Feb 2004 23:53:48 -0000	1.214
--- alias.c	21 Feb 2004 00:05:04 -0000
*************** new_alias_set (void)
*** 605,611 ****
    if (flag_strict_aliasing)
      {
        if (!alias_sets)
! 	VARRAY_GENERIC_PTR_INIT (alias_sets, 10, "alias sets");
        else
  	VARRAY_GROW (alias_sets, last_alias_set + 2);
        return ++last_alias_set;
--- 605,611 ----
    if (flag_strict_aliasing)
      {
        if (!alias_sets)
! 	VARRAY_GENERIC_PTR_INIT (alias_sets, 10, "alias sets", VARRAY_GGC);
        else
  	VARRAY_GROW (alias_sets, last_alias_set + 2);
        return ++last_alias_set;
*************** init_alias_analysis (void)
*** 2750,2756 ****
      }
    else
      {
!       VARRAY_RTX_INIT (reg_base_value, maxreg, "reg_base_value");
      }
  
    new_reg_base_value = xmalloc (maxreg * sizeof (rtx));
--- 2750,2756 ----
      }
    else
      {
!       VARRAY_RTX_INIT (reg_base_value, maxreg, "reg_base_value", VARRAY_GGC);
      }
  
    new_reg_base_value = xmalloc (maxreg * sizeof (rtx));
Index: cfglayout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfglayout.c,v
retrieving revision 1.52
diff -c -3 -p -r1.52 cfglayout.c
*** cfglayout.c	31 Jan 2004 02:06:44 -0000	1.52
--- cfglayout.c	21 Feb 2004 00:05:04 -0000
*************** insn_locators_initialize (void)
*** 260,271 ****
  
    prologue_locator = epilogue_locator = 0;
  
!   VARRAY_INT_INIT (block_locators_locs, 32, "block_locators_locs");
!   VARRAY_TREE_INIT (block_locators_blocks, 32, "block_locators_blocks");
!   VARRAY_INT_INIT (line_locators_locs, 32, "line_locators_locs");
!   VARRAY_INT_INIT (line_locators_lines, 32, "line_locators_lines");
!   VARRAY_INT_INIT (file_locators_locs, 32, "file_locators_locs");
!   VARRAY_CHAR_PTR_INIT (file_locators_files, 32, "file_locators_files");
  
    for (insn = get_insns (); insn; insn = next)
      {
--- 260,271 ----
  
    prologue_locator = epilogue_locator = 0;
  
!   VARRAY_INT_INIT (block_locators_locs, 32, "block_locators_locs", VARRAY_GGC);
!   VARRAY_TREE_INIT (block_locators_blocks, 32, "block_locators_blocks", VARRAY_GGC);
!   VARRAY_INT_INIT (line_locators_locs, 32, "line_locators_locs", VARRAY_GGC);
!   VARRAY_INT_INIT (line_locators_lines, 32, "line_locators_lines", VARRAY_GGC);
!   VARRAY_INT_INIT (file_locators_locs, 32, "file_locators_locs", VARRAY_GGC);
!   VARRAY_CHAR_PTR_INIT (file_locators_files, 32, "file_locators_files", VARRAY_GGC);
  
    for (insn = get_insns (); insn; insn = next)
      {
Index: cselib.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cselib.c,v
retrieving revision 1.38
diff -c -3 -p -r1.38 cselib.c
*** cselib.c	2 Feb 2004 00:17:09 -0000	1.38
--- cselib.c	21 Feb 2004 00:05:04 -0000
*************** cselib_init (void)
*** 1413,1420 ****
      }
    else
      {
!       VARRAY_ELT_LIST_INIT (reg_values, cselib_nregs, "reg_values");
!       VARRAY_UINT_INIT (used_regs, cselib_nregs, "used_regs");
      }
    hash_table = htab_create_ggc (31, get_value_hash, entry_and_rtx_equal_p,
  				NULL);
--- 1413,1420 ----
      }
    else
      {
!       VARRAY_ELT_LIST_INIT (reg_values, cselib_nregs, "reg_values", VARRAY_GGC);
!       VARRAY_UINT_INIT (used_regs, cselib_nregs, "used_regs", VARRAY_GGC);
      }
    hash_table = htab_create_ggc (31, get_value_hash, entry_and_rtx_equal_p,
  				NULL);
Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.495
diff -c -3 -p -r1.495 dwarf2out.c
*** dwarf2out.c	18 Feb 2004 11:02:15 -0000	1.495
--- dwarf2out.c	21 Feb 2004 00:05:05 -0000
*************** static void
*** 12779,12786 ****
  init_file_table (void)
  {
    /* Allocate the initial hunk of the file_table.  */
!   VARRAY_CHAR_PTR_INIT (file_table, 64, "file_table");
!   VARRAY_UINT_INIT (file_table_emitted, 64, "file_table_emitted");
  
    /* Skip the first entry - file numbers begin at 1.  */
    VARRAY_PUSH_CHAR_PTR (file_table, NULL);
--- 12779,12786 ----
  init_file_table (void)
  {
    /* Allocate the initial hunk of the file_table.  */
!   VARRAY_CHAR_PTR_INIT (file_table, 64, "file_table", VARRAY_GGC);
!   VARRAY_UINT_INIT (file_table_emitted, 64, "file_table_emitted", VARRAY_GGC);
  
    /* Skip the first entry - file numbers begin at 1.  */
    VARRAY_PUSH_CHAR_PTR (file_table, NULL);
*************** dwarf2out_init (const char *filename ATT
*** 13024,13030 ****
  				    decl_loc_table_eq, NULL);
  
    /* Allocate the initial hunk of the decl_scope_table.  */
!   VARRAY_TREE_INIT (decl_scope_table, 256, "decl_scope_table");
  
    /* Allocate the initial hunk of the abbrev_die_table.  */
    abbrev_die_table = ggc_alloc_cleared (ABBREV_DIE_TABLE_INCREMENT
--- 13024,13030 ----
  				    decl_loc_table_eq, NULL);
  
    /* Allocate the initial hunk of the decl_scope_table.  */
!   VARRAY_TREE_INIT (decl_scope_table, 256, "decl_scope_table", VARRAY_GGC);
  
    /* Allocate the initial hunk of the abbrev_die_table.  */
    abbrev_die_table = ggc_alloc_cleared (ABBREV_DIE_TABLE_INCREMENT
*************** dwarf2out_init (const char *filename ATT
*** 13049,13057 ****
       in this value in dwarf2out_finish.  */
    comp_unit_die = gen_compile_unit_die (NULL);
  
!   VARRAY_TREE_INIT (incomplete_types, 64, "incomplete_types");
  
!   VARRAY_RTX_INIT (used_rtx_varray, 32, "used_rtx_varray");
  
    ASM_GENERATE_INTERNAL_LABEL (text_end_label, TEXT_END_LABEL, 0);
    ASM_GENERATE_INTERNAL_LABEL (abbrev_section_label,
--- 13049,13057 ----
       in this value in dwarf2out_finish.  */
    comp_unit_die = gen_compile_unit_die (NULL);
  
!   VARRAY_TREE_INIT (incomplete_types, 64, "incomplete_types", VARRAY_GGC);
  
!   VARRAY_RTX_INIT (used_rtx_varray, 32, "used_rtx_varray", VARRAY_GGC);
  
    ASM_GENERATE_INTERNAL_LABEL (text_end_label, TEXT_END_LABEL, 0);
    ASM_GENERATE_INTERNAL_LABEL (abbrev_section_label,
Index: except.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/except.c,v
retrieving revision 1.258
diff -c -3 -p -r1.258 except.c
*** except.c	9 Feb 2004 21:18:45 -0000	1.258
--- except.c	21 Feb 2004 00:05:06 -0000
*************** assign_filter_values (void)
*** 1566,1573 ****
    int i;
    htab_t ttypes, ehspec;
  
!   VARRAY_TREE_INIT (cfun->eh->ttype_data, 16, "ttype_data");
!   VARRAY_UCHAR_INIT (cfun->eh->ehspec_data, 64, "ehspec_data");
  
    ttypes = htab_create (31, ttypes_filter_hash, ttypes_filter_eq, free);
    ehspec = htab_create (31, ehspec_filter_hash, ehspec_filter_eq, free);
--- 1566,1573 ----
    int i;
    htab_t ttypes, ehspec;
  
!   VARRAY_TREE_INIT (cfun->eh->ttype_data, 16, "ttype_data", VARRAY_GGC);
!   VARRAY_UCHAR_INIT (cfun->eh->ehspec_data, 64, "ehspec_data", VARRAY_GGC);
  
    ttypes = htab_create (31, ttypes_filter_hash, ttypes_filter_eq, free);
    ehspec = htab_create (31, ehspec_filter_hash, ehspec_filter_eq, free);
*************** sjlj_assign_call_site_values (rtx dispat
*** 1928,1934 ****
  
    /* First task: build the action table.  */
  
!   VARRAY_UCHAR_INIT (cfun->eh->action_record_data, 64, "action_record_data");
    ar_hash = htab_create (31, action_record_hash, action_record_eq, free);
  
    for (i = cfun->eh->last_region_number; i > 0; --i)
--- 1928,1934 ----
  
    /* First task: build the action table.  */
  
!   VARRAY_UCHAR_INIT (cfun->eh->action_record_data, 64, "action_record_data", VARRAY_GGC);
    ar_hash = htab_create (31, action_record_hash, action_record_eq, free);
  
    for (i = cfun->eh->last_region_number; i > 0; --i)
*************** convert_to_eh_region_ranges (void)
*** 3303,3309 ****
    if (USING_SJLJ_EXCEPTIONS || cfun->eh->region_tree == NULL)
      return;
  
!   VARRAY_UCHAR_INIT (cfun->eh->action_record_data, 64, "action_record_data");
  
    ar_hash = htab_create (31, action_record_hash, action_record_eq, free);
  
--- 3303,3309 ----
    if (USING_SJLJ_EXCEPTIONS || cfun->eh->region_tree == NULL)
      return;
  
!   VARRAY_UCHAR_INIT (cfun->eh->action_record_data, 64, "action_record_data", VARRAY_GGC);
  
    ar_hash = htab_create (31, action_record_hash, action_record_eq, free);
  
Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.495
diff -c -3 -p -r1.495 function.c
*** function.c	17 Feb 2004 21:33:33 -0000	1.495
--- function.c	21 Feb 2004 00:05:06 -0000
*************** tree inline_function_decl;
*** 149,160 ****
  struct function *cfun = 0;
  
  /* These arrays record the INSN_UIDs of the prologue and epilogue insns.  */
! static GTY(()) varray_type prologue;
! static GTY(()) varray_type epilogue;
  
  /* Array of INSN_UIDs to hold the INSN_UIDs for each sibcall epilogue
     in this function.  */
! static GTY(()) varray_type sibcall_epilogue;
  
  /* In order to evaluate some expressions, such as function calls returning
     structures in memory, we need to temporarily allocate stack locations.
--- 149,160 ----
  struct function *cfun = 0;
  
  /* These arrays record the INSN_UIDs of the prologue and epilogue insns.  */
! static varray_type prologue;
! static varray_type epilogue;
  
  /* Array of INSN_UIDs to hold the INSN_UIDs for each sibcall epilogue
     in this function.  */
! static varray_type sibcall_epilogue;
  
  /* In order to evaluate some expressions, such as function calls returning
     structures in memory, we need to temporarily allocate stack locations.
*************** reorder_blocks (void)
*** 6118,6124 ****
    if (block == NULL_TREE)
      return;
  
!   VARRAY_TREE_INIT (block_stack, 10, "block_stack");
  
    /* Reset the TREE_ASM_WRITTEN bit for all blocks.  */
    reorder_blocks_0 (block);
--- 6118,6124 ----
    if (block == NULL_TREE)
      return;
  
!   VARRAY_TREE_INIT (block_stack, 10, "block_stack", VARRAY_MALLOC);
  
    /* Reset the TREE_ASM_WRITTEN bit for all blocks.  */
    reorder_blocks_0 (block);
*************** reorder_blocks (void)
*** 6133,6138 ****
--- 6133,6140 ----
  
    /* Remove deleted blocks from the block fragment chains.  */
    reorder_fix_fragments (block);
+ 
+   VARRAY_FREE (block_stack);
  }
  
  /* Helper function for reorder_blocks.  Reset TREE_ASM_WRITTEN.  */
*************** init_function_for_compilation (void)
*** 6517,6525 ****
    reg_renumber = 0;
  
    /* No prologue/epilogue insns yet.  */
!   VARRAY_GROW (prologue, 0);
!   VARRAY_GROW (epilogue, 0);
!   VARRAY_GROW (sibcall_epilogue, 0);
  }
  
  /* Expand a call to __main at the beginning of a possible main function.  */
--- 6519,6533 ----
    reg_renumber = 0;
  
    /* No prologue/epilogue insns yet.  */
!   if (prologue)
!     VARRAY_FREE (prologue);
!   if (epilogue)
!     VARRAY_FREE (epilogue);
!   if (sibcall_epilogue)
!     VARRAY_FREE (sibcall_epilogue);
!   VARRAY_INT_INIT (prologue, 0, "prologue", VARRAY_MALLOC);
!   VARRAY_INT_INIT (epilogue, 0, "epilogue", VARRAY_MALLOC);
!   VARRAY_INT_INIT (sibcall_epilogue, 0, "sibcall_epilogue", VARRAY_MALLOC);
  }
  
  /* Expand a call to __main at the beginning of a possible main function.  */
*************** reposition_prologue_and_epilogue_notes (
*** 8100,8108 ****
  void
  init_function_once (void)
  {
-   VARRAY_INT_INIT (prologue, 0, "prologue");
-   VARRAY_INT_INIT (epilogue, 0, "epilogue");
-   VARRAY_INT_INIT (sibcall_epilogue, 0, "sibcall_epilogue");
  }
  
  /* Returns the name of the current function.  */
--- 8108,8113 ----
Index: genautomata.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/genautomata.c,v
retrieving revision 1.57
diff -c -3 -p -r1.57 genautomata.c
*** genautomata.c	8 Feb 2004 19:45:46 -0000	1.57
--- genautomata.c	21 Feb 2004 00:05:07 -0000
*************** static struct obstack irp;
*** 550,556 ****
      {	 \
        vla_ptr_t *const _vla_ptr = &(vla);                                \
  	 \
!       VARRAY_GENERIC_PTR_INIT (_vla_ptr->varray, allocated_length, name);\
        _vla_ptr->length = 0;                                              \
      }									 \
    while (0)
--- 550,557 ----
      {	 \
        vla_ptr_t *const _vla_ptr = &(vla);                                \
  	 \
!       VARRAY_GENERIC_PTR_INIT (_vla_ptr->varray, allocated_length, name, \
! 		      	       VARRAY_MALLOC);				 \
        _vla_ptr->length = 0;                                              \
      }									 \
    while (0)
*************** static struct obstack irp;
*** 608,614 ****
    do {                                                                \
      vla_hwint_t *const _vla_ptr = &(vla);                             \
                                                                        \
!     VARRAY_WIDE_INT_INIT (_vla_ptr->varray, allocated_length, name);  \
      _vla_ptr->length = 0;                                             \
    } while (0)
  
--- 609,616 ----
    do {                                                                \
      vla_hwint_t *const _vla_ptr = &(vla);                             \
                                                                        \
!     VARRAY_WIDE_INT_INIT (_vla_ptr->varray, allocated_length, name,   \
! 		          VARRAY_MALLOC);			      \
      _vla_ptr->length = 0;                                             \
    } while (0)
  
Index: ggc-none.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ggc-none.c,v
retrieving revision 1.15
diff -c -3 -p -r1.15 ggc-none.c
*** ggc-none.c	27 Oct 2003 00:26:52 -0000	1.15
--- ggc-none.c	21 Feb 2004 00:05:07 -0000
*************** ggc_realloc (void *x, size_t size)
*** 60,62 ****
--- 60,68 ----
  {
    return xrealloc (x, size);
  }
+ 
+ void
+ ggc_free (void *ptr)
+ {
+   free (ptr);
+ }
Index: insn-addr.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/insn-addr.h,v
retrieving revision 1.6
diff -c -3 -p -r1.6 insn-addr.h
*** insn-addr.h	4 Jun 2002 07:07:48 -0000	1.6
--- insn-addr.h	21 Feb 2004 00:05:07 -0000
*************** Software Foundation, 59 Temple Place - S
*** 23,36 ****
  
  #include "varray.h"
  
! extern GTY(()) varray_type insn_addresses_;
  extern int insn_current_address;
  
  #define INSN_ADDRESSES_DEFN() varray_type insn_addresses_
  #define INSN_ADDRESSES(id) VARRAY_INT (insn_addresses_, (id))
  #define INSN_ADDRESSES_ALLOC(size) \
!   VARRAY_INT_INIT (insn_addresses_, (size), "insn_addresses")
! #define INSN_ADDRESSES_FREE() (insn_addresses_ = 0)
  #define INSN_ADDRESSES_SET_P() (insn_addresses_ != 0)
  #define INSN_ADDRESSES_SIZE() VARRAY_SIZE (insn_addresses_)
  #define INSN_ADDRESSES_NEW(insn, addr) do \
--- 23,36 ----
  
  #include "varray.h"
  
! extern varray_type insn_addresses_;
  extern int insn_current_address;
  
  #define INSN_ADDRESSES_DEFN() varray_type insn_addresses_
  #define INSN_ADDRESSES(id) VARRAY_INT (insn_addresses_, (id))
  #define INSN_ADDRESSES_ALLOC(size) \
!   VARRAY_INT_INIT (insn_addresses_, (size), "insn_addresses", VARRAY_MALLOC)
! #define INSN_ADDRESSES_FREE() VARRAY_FREE (insn_addresses_)
  #define INSN_ADDRESSES_SET_P() (insn_addresses_ != 0)
  #define INSN_ADDRESSES_SIZE() VARRAY_SIZE (insn_addresses_)
  #define INSN_ADDRESSES_NEW(insn, addr) do \
Index: integrate.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/integrate.c,v
retrieving revision 1.248
diff -c -3 -p -r1.248 integrate.c
*** integrate.c	17 Feb 2004 21:33:33 -0000	1.248
--- integrate.c	21 Feb 2004 00:05:07 -0000
*************** expand_inline_function (tree fndecl, tre
*** 826,832 ****
    map = xcalloc (1, sizeof (struct inline_remap));
    map->fndecl = fndecl;
  
!   VARRAY_TREE_INIT (map->block_map, 10, "block_map");
    map->reg_map = xcalloc (max_regno, sizeof (rtx));
  
    /* We used to use alloca here, but the size of what it would try to
--- 826,832 ----
    map = xcalloc (1, sizeof (struct inline_remap));
    map->fndecl = fndecl;
  
!   VARRAY_TREE_INIT (map->block_map, 10, "block_map", VARRAY_GGC);
    map->reg_map = xcalloc (max_regno, sizeof (rtx));
  
    /* We used to use alloca here, but the size of what it would try to
*************** expand_inline_function (tree fndecl, tre
*** 863,869 ****
  			    + (max_regno - FIRST_PSEUDO_REGISTER)
  			    + 15 * nargs
  			    + 10),
! 			   "expand_inline_function");
    map->const_age = 0;
  
    /* Record the current insn in case we have to set up pointers to frame
--- 863,869 ----
  			    + (max_regno - FIRST_PSEUDO_REGISTER)
  			    + 15 * nargs
  			    + 10),
! 			   "expand_inline_function", VARRAY_GGC);
    map->const_age = 0;
  
    /* Record the current insn in case we have to set up pointers to frame
Index: reg-stack.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reg-stack.c,v
retrieving revision 1.143
diff -c -3 -p -r1.143 reg-stack.c
*** reg-stack.c	6 Feb 2004 13:57:15 -0000	1.143
--- reg-stack.c	21 Feb 2004 00:05:07 -0000
*************** reg_to_stack (rtx first, FILE *file)
*** 482,490 ****
    /* Allocate a cache for stack_regs_mentioned.  */
    max_uid = get_max_uid ();
    VARRAY_CHAR_INIT (stack_regs_mentioned_data, max_uid + 1,
! 		    "stack_regs_mentioned cache");
  
    convert_regs (file);
  
    free_aux_for_blocks ();
    return true;
--- 482,491 ----
    /* Allocate a cache for stack_regs_mentioned.  */
    max_uid = get_max_uid ();
    VARRAY_CHAR_INIT (stack_regs_mentioned_data, max_uid + 1,
! 		    "stack_regs_mentioned cache", VARRAY_MALLOC);
  
    convert_regs (file);
+   VARRAY_FREE (stack_regs_mentioned_data);
  
    free_aux_for_blocks ();
    return true;
Index: tree-inline.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
retrieving revision 1.93
diff -c -3 -p -r1.93 tree-inline.c
*** tree-inline.c	14 Feb 2004 19:38:46 -0000	1.93
--- tree-inline.c	21 Feb 2004 00:05:08 -0000
*************** optimize_inline_calls (tree fn)
*** 1622,1628 ****
    id.decl = fn;
    id.current_decl = fn;
    /* Don't allow recursion into FN.  */
!   VARRAY_TREE_INIT (id.fns, 32, "fns");
    VARRAY_PUSH_TREE (id.fns, fn);
    /* Or any functions that aren't finished yet.  */
    prev_fn = NULL_TREE;
--- 1622,1628 ----
    id.decl = fn;
    id.current_decl = fn;
    /* Don't allow recursion into FN.  */
!   VARRAY_TREE_INIT (id.fns, 32, "fns", VARRAY_MALLOC);
    VARRAY_PUSH_TREE (id.fns, fn);
    /* Or any functions that aren't finished yet.  */
    prev_fn = NULL_TREE;
*************** optimize_inline_calls (tree fn)
*** 1636,1642 ****
  	     (&id.fns, prev_fn));
  
    /* Create the list of functions this call will inline.  */
!   VARRAY_TREE_INIT (id.inlined_fns, 32, "inlined_fns");
  
    /* Keep track of the low-water mark, i.e., the point where the first
       real inlining is represented in ID.FNS.  */
--- 1636,1642 ----
  	     (&id.fns, prev_fn));
  
    /* Create the list of functions this call will inline.  */
!   VARRAY_TREE_INIT (id.inlined_fns, 32, "inlined_fns", VARRAY_MALLOC);
  
    /* Keep track of the low-water mark, i.e., the point where the first
       real inlining is represented in ID.FNS.  */
*************** optimize_inline_calls (tree fn)
*** 1659,1664 ****
--- 1659,1666 ----
  		VARRAY_ACTIVE_SIZE (id.inlined_fns) * sizeof (tree));
        DECL_INLINED_FNS (fn) = ifn;
      }
+   VARRAY_FREE (id.fns);
+   VARRAY_FREE (id.inlined_fns);
  }
  
  /* FN is a function that has a complete body, and CLONE is a function
*************** clone_body (tree clone, tree fn, void *a
*** 1675,1681 ****
       there's an in-charge parameter, map it to an appropriate
       constant.  */
    memset (&id, 0, sizeof (id));
!   VARRAY_TREE_INIT (id.fns, 2, "fns");
    VARRAY_PUSH_TREE (id.fns, clone);
    VARRAY_PUSH_TREE (id.fns, fn);
    id.decl_map = (splay_tree)arg_map;
--- 1677,1683 ----
       there's an in-charge parameter, map it to an appropriate
       constant.  */
    memset (&id, 0, sizeof (id));
!   VARRAY_TREE_INIT (id.fns, 2, "fns", VARRAY_MALLOC);
    VARRAY_PUSH_TREE (id.fns, clone);
    VARRAY_PUSH_TREE (id.fns, fn);
    id.decl_map = (splay_tree)arg_map;
*************** clone_body (tree clone, tree fn, void *a
*** 1686,1691 ****
--- 1688,1695 ----
  
    /* Actually copy the body.  */
    TREE_CHAIN (DECL_SAVED_TREE (clone)) = copy_body (&id);
+   VARRAY_FREE (id.fns);
+   VARRAY_FREE (id.inlined_fns);
  }
  
  /* Apply FUNC to all the sub-trees of TP in a pre-order traversal.
Index: unroll.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unroll.c,v
retrieving revision 1.205
diff -c -3 -p -r1.205 unroll.c
*** unroll.c	1 Dec 2003 21:57:07 -0000	1.205
--- unroll.c	21 Feb 2004 00:05:08 -0000
*************** unroll_loop (struct loop *loop, int insn
*** 856,862 ****
  	  map->reg_map = xmalloc (maxregnum * sizeof (rtx));
  
  	  VARRAY_CONST_EQUIV_INIT (map->const_equiv_varray, maxregnum,
! 				   "unroll_loop_precondition");
  	  global_const_equiv_varray = map->const_equiv_varray;
  
  	  init_reg_map (map, maxregnum);
--- 856,862 ----
  	  map->reg_map = xmalloc (maxregnum * sizeof (rtx));
  
  	  VARRAY_CONST_EQUIV_INIT (map->const_equiv_varray, maxregnum,
! 				   "unroll_loop_precondition", VARRAY_MALLOC);
  	  global_const_equiv_varray = map->const_equiv_varray;
  
  	  init_reg_map (map, maxregnum);
*************** unroll_loop (struct loop *loop, int insn
*** 1164,1170 ****
    if (map->const_equiv_varray == 0)
      VARRAY_CONST_EQUIV_INIT (map->const_equiv_varray,
  			     maxregnum + temp * unroll_number * 2,
! 			     "unroll_loop");
    global_const_equiv_varray = map->const_equiv_varray;
  
    /* Search the list of bivs and givs to find ones which need to be remapped
--- 1164,1170 ----
    if (map->const_equiv_varray == 0)
      VARRAY_CONST_EQUIV_INIT (map->const_equiv_varray,
  			     maxregnum + temp * unroll_number * 2,
! 			     "unroll_loop", VARRAY_MALLOC);
    global_const_equiv_varray = map->const_equiv_varray;
  
    /* Search the list of bivs and givs to find ones which need to be remapped
Index: varray.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varray.c,v
retrieving revision 1.27
diff -c -3 -p -r1.27 varray.c
*** varray.c	25 Jan 2004 03:52:42 -0000	1.27
--- varray.c	21 Feb 2004 00:05:09 -0000
*************** varray_descriptor (const char *name)
*** 81,120 ****
  }
  #endif
  
- /* Do not add any more non-GC items here.  Please either remove or GC
-    those items that are not GCed.  */
- 
  static const struct {
    unsigned char size;
-   bool uses_ggc;
  } element[NUM_VARRAY_DATA] = {
!   { sizeof (char), 1 },
!   { sizeof (unsigned char), 1 },
!   { sizeof (short), 1 },
!   { sizeof (unsigned short), 1 },
!   { sizeof (int), 1 },
!   { sizeof (unsigned int), 1 },
!   { sizeof (long), 1 },
!   { sizeof (unsigned long), 1 },
!   { sizeof (HOST_WIDE_INT), 1 },
!   { sizeof (unsigned HOST_WIDE_INT), 1 },
!   { sizeof (void *), 1 },
!   { sizeof (char *), 1 },
!   { sizeof (struct rtx_def *), 1 },
!   { sizeof (struct rtvec_def *), 1 },
!   { sizeof (union tree_node *), 1 },
!   { sizeof (struct bitmap_head_def *), 1 },
!   { sizeof (struct reg_info_def *), 0 },
!   { sizeof (struct const_equiv_data), 0 },
!   { sizeof (struct basic_block_def *), 0 },
!   { sizeof (struct elt_list *), 1 },
  };
  
  /* Allocate a virtual array with NUM_ELEMENT elements, each of which is
     ELEMENT_SIZE bytes long, named NAME.  Array elements are zeroed.  */
  varray_type
  varray_init (size_t num_elements, enum varray_data_enum element_kind,
! 	     const char *name)
  {
    size_t data_size = num_elements * element[element_kind].size;
    varray_type ptr;
--- 81,116 ----
  }
  #endif
  
  static const struct {
    unsigned char size;
  } element[NUM_VARRAY_DATA] = {
!   { sizeof (char) },
!   { sizeof (unsigned char) },
!   { sizeof (short) },
!   { sizeof (unsigned short) },
!   { sizeof (int) },
!   { sizeof (unsigned int) },
!   { sizeof (long) },
!   { sizeof (unsigned long) },
!   { sizeof (HOST_WIDE_INT) },
!   { sizeof (unsigned HOST_WIDE_INT) },
!   { sizeof (void *) },
!   { sizeof (char *) },
!   { sizeof (struct rtx_def *) },
!   { sizeof (struct rtvec_def *) },
!   { sizeof (union tree_node *) },
!   { sizeof (struct bitmap_head_def *) },
!   { sizeof (struct reg_info_def *) },
!   { sizeof (struct const_equiv_data) },
!   { sizeof (struct basic_block_def *) },
!   { sizeof (struct elt_list *) },
  };
  
  /* Allocate a virtual array with NUM_ELEMENT elements, each of which is
     ELEMENT_SIZE bytes long, named NAME.  Array elements are zeroed.  */
  varray_type
  varray_init (size_t num_elements, enum varray_data_enum element_kind,
! 	     const char *name, enum varray_allocator allocator)
  {
    size_t data_size = num_elements * element[element_kind].size;
    varray_type ptr;
*************** varray_init (size_t num_elements, enum v
*** 124,134 ****
    desc->created++;
    desc->allocated += data_size + VARRAY_HDR_SIZE;
  #endif
!   if (element[element_kind].uses_ggc)
      ptr = ggc_alloc_cleared (VARRAY_HDR_SIZE + data_size);
    else
      ptr = xcalloc (VARRAY_HDR_SIZE + data_size, 1);
  
    ptr->num_elements = num_elements;
    ptr->elements_used = 0;
    ptr->type = element_kind;
--- 120,131 ----
    desc->created++;
    desc->allocated += data_size + VARRAY_HDR_SIZE;
  #endif
!   if (allocator == VARRAY_GGC)
      ptr = ggc_alloc_cleared (VARRAY_HDR_SIZE + data_size);
    else
      ptr = xcalloc (VARRAY_HDR_SIZE + data_size, 1);
  
+   ptr->allocator = allocator;
    ptr->num_elements = num_elements;
    ptr->elements_used = 0;
    ptr->type = element_kind;
*************** varray_init (size_t num_elements, enum v
*** 136,141 ****
--- 133,148 ----
    return ptr;
  }
  
+ /* Free memory used by varray.  */
+ void
+ varray_free (varray_type va)
+ {
+   if (va->allocator == VARRAY_GGC)
+     ggc_free (va);
+   else
+     free (va);
+ }
+ 
  /* Grow/shrink the virtual array VA to N elements.  Zero any new elements
     allocated.  */
  varray_type
*************** varray_grow (varray_type va, size_t n)
*** 157,163 ****
  #endif
  
  
!       if (element[va->type].uses_ggc)
  	va = ggc_realloc (va, VARRAY_HDR_SIZE + data_size);
        else
  	va = xrealloc (va, VARRAY_HDR_SIZE + data_size);
--- 164,170 ----
  #endif
  
  
!       if (va->allocator == VARRAY_GGC)
  	va = ggc_realloc (va, VARRAY_HDR_SIZE + data_size);
        else
  	va = xrealloc (va, VARRAY_HDR_SIZE + data_size);
Index: varray.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varray.h,v
retrieving revision 1.35
diff -c -3 -p -r1.35 varray.h
*** varray.h	21 Jan 2004 20:40:04 -0000	1.35
--- varray.h	21 Feb 2004 00:05:09 -0000
*************** typedef union varray_data_tag GTY (()) {
*** 126,131 ****
--- 126,133 ----
  				tag ("VARRAY_DATA_BB")))	bb[1];
    struct elt_list	 *GTY ((length ("%0.num_elements"),
  				tag ("VARRAY_DATA_TE")))	te[1];
+   char *		 *GTY ((length ("%0.num_elements"), skip (""),
+ 				tag ("NUM_VARRAY_DATA")))	skip[1];
  } varray_data;
  
  /* Virtual array of pointers header.  */
*************** struct varray_head_tag GTY(()) {
*** 133,213 ****
    size_t	num_elements;	/* Maximum element number allocated.  */
    size_t        elements_used;  /* The number of elements used, if
  				   using VARRAY_PUSH/VARRAY_POP.  */
-   enum varray_data_enum type;	/* The kind of elements in the varray.  */
    const char   *name;		/* name of the varray for reporting errors */
!   varray_data	GTY ((desc ("%0.type"))) data;	/* The data elements follow,
! 						   must be last.  */
  };
  typedef struct varray_head_tag *varray_type;
  
  /* Allocate a virtual array with NUM elements, each of which is SIZE bytes
     long, named NAME.  Array elements are zeroed.  */
! extern varray_type varray_init (size_t, enum varray_data_enum, const char *);
  
! #define VARRAY_CHAR_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_C, name)
  
! #define VARRAY_UCHAR_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_UC, name)
  
! #define VARRAY_SHORT_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_S, name)
  
! #define VARRAY_USHORT_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_US, name)
  
! #define VARRAY_INT_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_I, name)
  
! #define VARRAY_UINT_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_U, name)
  
! #define VARRAY_LONG_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_L, name)
  
! #define VARRAY_ULONG_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_UL, name)
  
! #define VARRAY_WIDE_INT_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_HINT, name)
  
! #define VARRAY_UWIDE_INT_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_UHINT, name)
  
! #define VARRAY_GENERIC_PTR_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_GENERIC, name)
  
! #define VARRAY_CHAR_PTR_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_CPTR, name)
  
! #define VARRAY_RTX_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_RTX, name)
  
! #define VARRAY_RTVEC_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_RTVEC, name)
  
! #define VARRAY_TREE_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_TREE, name)
  
! #define VARRAY_BITMAP_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_BITMAP, name)
  
  #define VARRAY_REG_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_REG, name)
  
! #define VARRAY_CONST_EQUIV_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_CONST_EQUIV, name)
  
  #define VARRAY_BB_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_BB, name)
  
! #define VARRAY_ELT_LIST_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_TE, name)
  
  /* Free up memory allocated by the virtual array, but do not free any of the
     elements involved.  */
  #define VARRAY_FREE(vp) \
!   do { if (vp) { free (vp); vp = (varray_type) 0; } } while (0)
  
  /* Grow/shrink the virtual array VA to N elements.  */
  extern varray_type varray_grow (varray_type, size_t);
--- 135,224 ----
    size_t	num_elements;	/* Maximum element number allocated.  */
    size_t        elements_used;  /* The number of elements used, if
  				   using VARRAY_PUSH/VARRAY_POP.  */
    const char   *name;		/* name of the varray for reporting errors */
!   unsigned char allocator;	/* varrray_allocator enum specifing type of varray.  */
!   unsigned char type;		/* The kind of elements in the varray in varray_data_enum.  */
!   varray_data	GTY ((desc ("%0.allocator ? %0.type : NUM_VARRAY_DATA"))) data;
!   				/* The data elements follow, must be last.  */
  };
  typedef struct varray_head_tag *varray_type;
  
+ enum varray_allocator
+ {
+ 	VARRAY_MALLOC,
+ 	VARRAY_GGC
+ };
+ 
  /* Allocate a virtual array with NUM elements, each of which is SIZE bytes
     long, named NAME.  Array elements are zeroed.  */
! extern varray_type varray_init (size_t, enum varray_data_enum, const char *, enum varray_allocator);
  
! extern void varray_free (varray_type);
  
! #define VARRAY_CHAR_INIT(va, num, name, allocator) \
!   va = varray_init (num, VARRAY_DATA_C, name, allocator)
  
! #define VARRAY_UCHAR_INIT(va, num, name, allocator) \
!   va = varray_init (num, VARRAY_DATA_UC, name, allocator)
  
! #define VARRAY_SHORT_INIT(va, num, name, allocator) \
!   va = varray_init (num, VARRAY_DATA_S, name, allocator)
  
! #define VARRAY_USHORT_INIT(va, num, name, allocator) \
!   va = varray_init (num, VARRAY_DATA_US, name, allocator)
  
! #define VARRAY_INT_INIT(va, num, name, allocator) \
!   va = varray_init (num, VARRAY_DATA_I, name, allocator)
  
! #define VARRAY_UINT_INIT(va, num, name, allocator) \
!   va = varray_init (num, VARRAY_DATA_U, name, allocator)
  
! #define VARRAY_LONG_INIT(va, num, name, allocator) \
!   va = varray_init (num, VARRAY_DATA_L, name, allocator)
  
! #define VARRAY_ULONG_INIT(va, num, name, allocator) \
!   va = varray_init (num, VARRAY_DATA_UL, name, allocator)
  
! #define VARRAY_WIDE_INT_INIT(va, num, name, allocator) \
!   va = varray_init (num, VARRAY_DATA_HINT, name, allocator)
  
! #define VARRAY_UWIDE_INT_INIT(va, num, name, allocator) \
!   va = varray_init (num, VARRAY_DATA_UHINT, name, allocator)
  
! #define VARRAY_GENERIC_PTR_INIT(va, num, name, allocator) \
!   va = varray_init (num, VARRAY_DATA_GENERIC, name, allocator)
  
! #define VARRAY_CHAR_PTR_INIT(va, num, name, allocator) \
!   va = varray_init (num, VARRAY_DATA_CPTR, name, allocator)
  
! #define VARRAY_RTX_INIT(va, num, name, allocator) \
!   va = varray_init (num, VARRAY_DATA_RTX, name, allocator)
  
! #define VARRAY_RTVEC_INIT(va, num, name, allocator) \
!   va = varray_init (num, VARRAY_DATA_RTVEC, name, allocator)
  
! #define VARRAY_TREE_INIT(va, num, name, allocator) \
!   va = varray_init (num, VARRAY_DATA_TREE, name, allocator)
! 
! #define VARRAY_BITMAP_INIT(va, num, name, allocator) \
!   va = varray_init (num, VARRAY_DATA_BITMAP, name, allocator)
  
  #define VARRAY_REG_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_REG, name, VARRAY_MALLOC)
  
! #define VARRAY_CONST_EQUIV_INIT(va, num, name, allocator) \
!   va = varray_init (num, VARRAY_DATA_CONST_EQUIV, name, allocator)
  
  #define VARRAY_BB_INIT(va, num, name) \
!   va = varray_init (num, VARRAY_DATA_BB, name, VARRAY_MALLOC)
  
! #define VARRAY_ELT_LIST_INIT(va, num, name, allocator) \
!   va = varray_init (num, VARRAY_DATA_TE, name, allocator)
  
  /* Free up memory allocated by the virtual array, but do not free any of the
     elements involved.  */
  #define VARRAY_FREE(vp) \
!   do { if (vp) { varray_free (vp); vp = (varray_type) 0; } } while (0)
  
  /* Grow/shrink the virtual array VA to N elements.  */
  extern varray_type varray_grow (varray_type, size_t);
*************** extern void varray_underflow (varray_typ
*** 328,331 ****
--- 339,343 ----
  #define VARRAY_TOP_CONST_EQUIV(VA)	VARRAY_TOP (VA, const_equiv)
  #define VARRAY_TOP_BB(VA)		VARRAY_TOP (VA, bb)
  
+ extern void dump_varray_statistics (void);
  #endif /* ! GCC_VARRAY_H */
Index: cp/class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/class.c,v
retrieving revision 1.601
diff -c -3 -p -r1.601 class.c
*** cp/class.c	16 Feb 2004 02:35:48 -0000	1.601
--- cp/class.c	21 Feb 2004 00:05:11 -0000
*************** init_class_processing (void)
*** 5335,5341 ****
    current_class_stack_size = 10;
    current_class_stack 
      = xmalloc (current_class_stack_size * sizeof (struct class_stack_node));
!   VARRAY_TREE_INIT (local_classes, 8, "local_classes");
  
    ridpointers[(int) RID_PUBLIC] = access_public_node;
    ridpointers[(int) RID_PRIVATE] = access_private_node;
--- 5335,5341 ----
    current_class_stack_size = 10;
    current_class_stack 
      = xmalloc (current_class_stack_size * sizeof (struct class_stack_node));
!   VARRAY_TREE_INIT (local_classes, 8, "local_classes", VARRAY_GGC);
  
    ridpointers[(int) RID_PUBLIC] = access_public_node;
    ridpointers[(int) RID_PRIVATE] = access_private_node;
*************** build_vtbl_initializer (tree binfo,
*** 7272,7278 ****
    /* Create an array for keeping track of the functions we've
       processed.  When we see multiple functions with the same
       signature, we share the vcall offsets.  */
!   VARRAY_TREE_INIT (vid.fns, 32, "fns");
    /* Add the vcall and vbase offset entries.  */
    build_vcall_and_vbase_vtbl_entries (binfo, &vid);
    /* Clear BINFO_VTABLE_PATH_MARKED; it's set by
--- 7272,7278 ----
    /* Create an array for keeping track of the functions we've
       processed.  When we see multiple functions with the same
       signature, we share the vcall offsets.  */
!   VARRAY_TREE_INIT (vid.fns, 32, "fns", VARRAY_MALLOC);
    /* Add the vcall and vbase offset entries.  */
    build_vcall_and_vbase_vtbl_entries (binfo, &vid);
    /* Clear BINFO_VTABLE_PATH_MARKED; it's set by
*************** build_vtbl_initializer (tree binfo,
*** 7408,7413 ****
--- 7408,7415 ----
    
    /* The negative offset initializers are also in reverse order.  */
    vid.inits = nreverse (vid.inits);
+ 
+   VARRAY_FREE (vid.fns);
  
    /* Chain the two together.  */
    return chainon (vid.inits, vfun_inits);
Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1187
diff -c -3 -p -r1.1187 decl.c
*** cp/decl.c	17 Feb 2004 21:33:40 -0000	1.1187
--- cp/decl.c	21 Feb 2004 00:05:12 -0000
*************** push_local_name (tree decl)
*** 955,961 ****
  
    timevar_push (TV_NAME_LOOKUP);
    if (!local_names)
!     VARRAY_TREE_INIT (local_names, 8, "local_names");
  
    name = DECL_NAME (decl);
  
--- 955,961 ----
  
    timevar_push (TV_NAME_LOOKUP);
    if (!local_names)
!     VARRAY_TREE_INIT (local_names, 8, "local_names", VARRAY_GGC);
  
    name = DECL_NAME (decl);
  
Index: cp/decl2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl2.c,v
retrieving revision 1.699
diff -c -3 -p -r1.699 decl2.c
*** cp/decl2.c	14 Feb 2004 00:49:12 -0000	1.699
--- cp/decl2.c	21 Feb 2004 00:05:12 -0000
*************** finish_static_data_member_decl (tree dec
*** 767,773 ****
    if (! processing_template_decl)
      {
        if (!pending_statics)
! 	VARRAY_TREE_INIT (pending_statics, 32, "pending_statics");
        VARRAY_PUSH_TREE (pending_statics, decl);
      }
  
--- 767,773 ----
    if (! processing_template_decl)
      {
        if (!pending_statics)
! 	VARRAY_TREE_INIT (pending_statics, 32, "pending_statics", VARRAY_GGC);
        VARRAY_PUSH_TREE (pending_statics, decl);
      }
  
*************** defer_fn (tree fn)
*** 1123,1129 ****
    DECL_DEFERRED_FN (fn) = 1;
    DECL_DEFER_OUTPUT (fn) = 1;
    if (!deferred_fns)
!     VARRAY_TREE_INIT (deferred_fns, 32, "deferred_fns");
  
    VARRAY_PUSH_TREE (deferred_fns, fn);
  }
--- 1123,1129 ----
    DECL_DEFERRED_FN (fn) = 1;
    DECL_DEFER_OUTPUT (fn) = 1;
    if (!deferred_fns)
!     VARRAY_TREE_INIT (deferred_fns, 32, "deferred_fns", VARRAY_GGC);
  
    VARRAY_PUSH_TREE (deferred_fns, fn);
  }
*************** start_static_storage_duration_function (
*** 2026,2032 ****
       static constructors and destructors.  */
    if (!ssdf_decls)
      {
!       VARRAY_TREE_INIT (ssdf_decls, 32, "ssdf_decls");
  
        /* Take this opportunity to initialize the map from priority
  	 numbers to information about that priority level.  */
--- 2026,2032 ----
       static constructors and destructors.  */
    if (!ssdf_decls)
      {
!       VARRAY_TREE_INIT (ssdf_decls, 32, "ssdf_decls", VARRAY_GGC);
  
        /* Take this opportunity to initialize the map from priority
  	 numbers to information about that priority level.  */
Index: cp/mangle.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/mangle.c,v
retrieving revision 1.98
diff -c -3 -p -r1.98 mangle.c
*** cp/mangle.c	17 Feb 2004 18:32:42 -0000	1.98
--- cp/mangle.c	21 Feb 2004 00:05:12 -0000
*************** start_mangling (const tree entity)
*** 2378,2384 ****
  {
    G.entity = entity;
    G.need_abi_warning = false;
!   VARRAY_TREE_INIT (G.substitutions, 1, "mangling substitutions");
    obstack_free (&G.name_obstack, obstack_base (&G.name_obstack));
  }
  
--- 2378,2384 ----
  {
    G.entity = entity;
    G.need_abi_warning = false;
!   VARRAY_TREE_INIT (G.substitutions, 1, "mangling substitutions", VARRAY_MALLOC);
    obstack_free (&G.name_obstack, obstack_base (&G.name_obstack));
  }
  
*************** finish_mangling (const bool warn)
*** 2395,2401 ****
  	     G.entity);
  
    /* Clear all the substitutions.  */
!   G.substitutions = 0;
  
    /* Null-terminate the string.  */
    write_char ('\0');
--- 2395,2401 ----
  	     G.entity);
  
    /* Clear all the substitutions.  */
!   VARRAY_FREE (G.substitutions);
  
    /* Null-terminate the string.  */
    write_char ('\0');
Index: cp/name-lookup.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/name-lookup.c,v
retrieving revision 1.38
diff -c -3 -p -r1.38 name-lookup.c
*** cp/name-lookup.c	16 Feb 2004 02:35:48 -0000	1.38
--- cp/name-lookup.c	21 Feb 2004 00:05:12 -0000
*************** begin_scope (scope_kind kind, tree entit
*** 1296,1302 ****
                          DECL_NAME (entity) == std_identifier
                          || DECL_NAME (entity) == global_scope_name
                          ? 200 : 10,
!                         "Static declarations");
        break;
  
      default:
--- 1296,1302 ----
                          DECL_NAME (entity) == std_identifier
                          || DECL_NAME (entity) == global_scope_name
                          ? 200 : 10,
!                         "Static declarations", VARRAY_GGC);
        break;
  
      default:
*************** push_to_top_level (void)
*** 4821,4827 ****
  
    scope_chain = s;
    current_function_decl = NULL_TREE;
!   VARRAY_TREE_INIT (current_lang_base, 10, "current_lang_base");
    current_lang_name = lang_name_cplusplus;
    current_namespace = global_namespace;
    timevar_pop (TV_NAME_LOOKUP);
--- 4821,4827 ----
  
    scope_chain = s;
    current_function_decl = NULL_TREE;
!   VARRAY_TREE_INIT (current_lang_base, 10, "current_lang_base", VARRAY_GGC);
    current_lang_name = lang_name_cplusplus;
    current_namespace = global_namespace;
    timevar_pop (TV_NAME_LOOKUP);
Index: cp/parser.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/parser.c,v
retrieving revision 1.173
diff -c -3 -p -r1.173 parser.c
*** cp/parser.c	13 Feb 2004 16:11:39 -0000	1.173
--- cp/parser.c	21 Feb 2004 00:05:13 -0000
*************** cp_lexer_new_main (void)
*** 326,335 ****
    lexer->main_lexer_p = true;
  
    /* Create the SAVED_TOKENS stack.  */
!   VARRAY_INT_INIT (lexer->saved_tokens, CP_SAVED_TOKENS_SIZE, "saved_tokens");
    
    /* Create the STRINGS array.  */
!   VARRAY_TREE_INIT (lexer->string_tokens, 32, "strings");
  
    /* Assume we are not debugging.  */
    lexer->debugging_p = false;
--- 326,335 ----
    lexer->main_lexer_p = true;
  
    /* Create the SAVED_TOKENS stack.  */
!   VARRAY_INT_INIT (lexer->saved_tokens, CP_SAVED_TOKENS_SIZE, "saved_tokens", VARRAY_GGC);
    
    /* Create the STRINGS array.  */
!   VARRAY_TREE_INIT (lexer->string_tokens, 32, "strings", VARRAY_GGC);
  
    /* Assume we are not debugging.  */
    lexer->debugging_p = false;
*************** cp_lexer_new_from_tokens (cp_token_cache
*** 377,386 ****
    lexer->main_lexer_p = false;
  
    /* Create the SAVED_TOKENS stack.  */
!   VARRAY_INT_INIT (lexer->saved_tokens, CP_SAVED_TOKENS_SIZE, "saved_tokens");
    
    /* Create the STRINGS array.  */
!   VARRAY_TREE_INIT (lexer->string_tokens, 32, "strings");
  
    /* Assume we are not debugging.  */
    lexer->debugging_p = false;
--- 377,386 ----
    lexer->main_lexer_p = false;
  
    /* Create the SAVED_TOKENS stack.  */
!   VARRAY_INT_INIT (lexer->saved_tokens, CP_SAVED_TOKENS_SIZE, "saved_tokens", VARRAY_GGC);
    
    /* Create the STRINGS array.  */
!   VARRAY_TREE_INIT (lexer->string_tokens, 32, "strings", VARRAY_GGC);
  
    /* Assume we are not debugging.  */
    lexer->debugging_p = false;
Index: cp/pt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/pt.c,v
retrieving revision 1.830
diff -c -3 -p -r1.830 pt.c
*** cp/pt.c	14 Feb 2004 11:28:59 -0000	1.830
--- cp/pt.c	21 Feb 2004 00:05:14 -0000
*************** maybe_begin_member_template_processing (
*** 414,420 ****
    /* Remember how many levels of template parameters we pushed so that
       we can pop them later.  */
    if (!inline_parm_levels)
!     VARRAY_INT_INIT (inline_parm_levels, 4, "inline_parm_levels");
    if (inline_parm_levels_used == inline_parm_levels->num_elements)
      VARRAY_GROW (inline_parm_levels, 2 * inline_parm_levels_used);
    VARRAY_INT (inline_parm_levels, inline_parm_levels_used) = levels;
--- 414,420 ----
    /* Remember how many levels of template parameters we pushed so that
       we can pop them later.  */
    if (!inline_parm_levels)
!     VARRAY_INT_INIT (inline_parm_levels, 4, "inline_parm_levels", VARRAY_GGC);
    if (inline_parm_levels_used == inline_parm_levels->num_elements)
      VARRAY_GROW (inline_parm_levels, 2 * inline_parm_levels_used);
    VARRAY_INT (inline_parm_levels, inline_parm_levels_used) = levels;
Index: cp/rtti.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/rtti.c,v
retrieving revision 1.178
diff -c -3 -p -r1.178 rtti.c
*** cp/rtti.c	7 Feb 2004 14:14:54 -0000	1.178
--- cp/rtti.c	21 Feb 2004 00:05:14 -0000
*************** init_rtti_processing (void)
*** 127,133 ****
    type_info_ptr_type = build_pointer_type (const_type_info_type);
    type_info_ref_type = build_reference_type (const_type_info_type);
  
!   VARRAY_TREE_INIT (unemitted_tinfo_decls, 10, "RTTI decls");
  
    create_tinfo_types ();
  }
--- 127,133 ----
    type_info_ptr_type = build_pointer_type (const_type_info_type);
    type_info_ref_type = build_reference_type (const_type_info_type);
  
!   VARRAY_TREE_INIT (unemitted_tinfo_decls, 10, "RTTI decls", VARRAY_GGC);
  
    create_tinfo_types ();
  }


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