diff options
author | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-07-24 09:49:56 +0000 |
---|---|---|
committer | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-07-24 09:49:56 +0000 |
commit | ecd52ea9dc3f3adb75bdc4f4897dfbb455a5d0f8 (patch) | |
tree | 7524c306e4effe5958489e003d2bb147a0439144 /gcc/tree.c | |
parent | ed74aa4415517f167aefeda7baadce6d572f713a (diff) | |
download | gcc-ecd52ea9dc3f3adb75bdc4f4897dfbb455a5d0f8.tar.gz |
gcc/
* sbitmap.h (SBITMAP_ELT_BITS): Use "1u" trick as for BITMAP_WORD_BITS.
Move test to check that there is a popcount function for the the number
of bits in SBITMAP_ELT_BITS to sbitmap.c.
* sbitmap.c: Test SBITMAP_ELT_BITS, not HOST_BITS_PER_WIDEST_FAST_INT.
MEM_STAT_INFO): Define in terms of their ALONE counterparts.
* configure.ac (GATHER_STATISTICS): Always define, non-zero if enabled.
* configure: Regenerate.
* statistics.h (GATHER_STATISTICS): Error out if it is not defined.
(GCC_MEM_STAT_ARGUMENTS): New define.
(ALONE_MEM_STAT_DECL): Define in terms of GCC_MEM_STAT_ARGUMENTS.
(ALONE_FINAL_MEM_STAT_DECL, ALONE_FINAL_PASS_MEM_STAT): New defines.
(MEM_STAT_DECL, FINAL_MEM_STAT_DECL, PASS_MEM_STAT, FINAL_PASS_MEM_STAT,
* ggc-internal.h (ggc_record_overhead): Use FINAL_MEM_STAT_DECL.
* ggc.h (ggc_record_overhead, ggc_free_overhead,
ggc_prune_overhead_list): Remove internal prototypes, they are defined
already in ggc-internal.h.
* ggc-common.c (struct loc_descriptor): Remove #ifdef GATHER_STATISTICS
wrappers.
(add_statistics): Likewise.
(dump_ggc_loc_statistics): Likewise. Return if GATHER_STATISTICS is 0.
* ggc-zone.c (struct page_entry): Remove #ifdef GATHER_STATISTICS
wrappers around "survived" and "stats" members.
(alloc_large_page): Always initialize survived.
(ggc_internal_alloc_zone_stat): Likewise.
Remove #ifdef GATHER_STATISTICS wrappers. Record overhead if
GATHER_STATISTICS is non-0.
(ggc_free): Convert #ifdef GATHER_STATISTICS to if-code.
(sweep_pages): Always increase survived.
(ggc_collect_1): Convert #ifdef GATHER_STATISTICS to if-code.
(calculate_average_page_survival): Always define.
(ggc_collect): Convert #ifdef GATHER_STATISTICS to if-code.
(ggc_print_statistics): Likewise.
(ggc_pch_read): Likewise.
* ggc-page.c (struct globals): Always define "stats" member.
(ggc_internal_alloc_stat): Convert #ifdef GATHER_STATISTICS to if-code.
(ggc_free): Likewise.
(ggc_collec): Likewise.
(ggc_print_statistics): Likewise.
* bitmap.h (struct bitmap_head_def): Always define "desc" member.
(bitmap_initialize_stat): Convert #ifdef GATHER_STATISTICS to if-code.
* gimple.h (enum gimple_alloc_kind): Always define.
(gimple_alloc_kind): Likewise.
* tree-flow.h (phinodes_print_statistics): Always define.
(ssanames_print_statistics): Likewise.
* vec.h (vec_heap_free): Always define.
(VEC_stack_alloc): Define if GATHER_STATISTICS is non-0.
* alloc-pool.c (alloc_pool_descriptor): Always define.
(create_alloc_pool): Convert #ifdef GATHER_STATISTICS to if-code.
(empty_alloc_pool): Likewise.
(pool_alloc): Likewise.
(pool_free): Likewise.
(dump_alloc_pool_statistics): Likewise.
(print_statistics): Always define.
* bitmap.c (struct bitmap_descriptor): Always define.
(bitmap_register): Pass ALONE_FINAL_PASS_MEM_STAT.
(register_overhead): Always define.
(bitmap_element_free): Convert #ifdef GATHER_STATISTICS to if-code.
(bitmap_element_allocate): Likewise.
(bitmap_elt_clear_from): Likewise.
(bitmap_obstack_alloc_stat): Likewise.
(bitmap_gc_alloc_stat): Likewise.
(bitmap_obstack_free): Likewise.
(bitmap_find_bit): Likewise.
(bitmap_ior_and_into): Likewise.
(bitmap_print): Likewise.
(dump_bitmap_statistics): Likewise. Return if GATHER_STATISTICS is 0.
* gimple.c (gimple_alloc_counts, gimple_alloc_sizes): Always define.
(gimple_alloc_kind_names): Likewise.
(gimple_alloc_stat): Convert #ifdef GATHER_STATISTICS to if-code.
(dump_gimple_statistics): Likewise. Return if GATHER_STATISTICS is 0.
* rtl.c (rtx_alloc_counts, rtx_alloc_sizes, rtvec_alloc_counts,
rtvec_alloc_sizes): Always define.
(rvec_alloc): Convert #ifdef GATHER_STATISTICS to if-code.
(rtx_alloc_stat): Likewise.
(dump_rtx_statistics): Likewise. Return if GATHER_STATISTICS is 0.
* tree.c (_obstack_allocated_p, tree_code_counts, tree_node_counts,
tree_node_sizes, tree_node_kind_names): Always define.
(record_node_allocation_statistics): Convert #ifdef GATHER_STATISTICS
to if-code.
(type_hash_canon): Likewise.
(dump_tree_statistics): Likewise.
* tree-ssanames.c (ssa_name_nodes_reused, ssa_name_nodes_created):
Always define.
(ssanames_print_statistics): Likewise.
(make_ssa_name_fn): Convert #ifdef GATHER_STATISTICS to if-code.
* tree-phinodes.c (phi_nodes_reused, phi_nodes_created): Always define.
(phinodes_print_statistics): Likewise.
(allocate_phi_node): Convert #ifdef GATHER_STATISTICS to if-code.
* vec.c (struct vec_descriptor): Always define.
(hash_descriptor, eq_descriptor, ptr_hash_entry, hash_ptr, eq_ptr,
vec_descriptor, rester_overhead, free_overhead): Likewise.
(cmp_statistic): Likewise.
(vec_heap_free): Convert #ifdef GATHER_STATISTICS to if-code.
(vec_heap_o_reserve_1): Likewise.
(dump_vec_loc_statistics): Likewise.
cp/
* cp/class.c (n_vtables, n_vtable_entries, n_vtable_searches,
n_vtable_elems, n_convert_harshness, n_compute_conversion_costs,
n_inner_fields_searched): Always define.
(build_primary_vtable): Convert #ifdef GATHER_STATISTICS to if-code.
(print_class_statistics): Convert #ifdef GATHER_STATISTICS to if-code.
* cp/tree.c (depth_reached): Always define global.
(cxx_print_statistics): Convert #ifdef GATHER_STATISTICS to if-code.
* cp/pt.c (depth_reached): Always define.
(push_tinst_level): Convert #ifdef GATHER_STATISTICS to if-code.
* cp/search.c (n_fields_searched, n_calls_lookup_field,
n_calls_lookup_field_1, n_calls_lookup_fnfields,
n_calls_lookup_fnfields_1, n_calls_get_base_type,
n_outer_fields_searched, n_contexts_saved): Always define.
(lookup_field_1): Convert #ifdef GATHER_STATISTICS to if-code.
(lookup_member): Likewise.
(lookup_fnfields_idx_nolazy): Likewise.
(print_search_statistics): Likewise.
(reinit_search_statistics): Unconditionally re-set counters.
* cp/lex.c (retrofit_lang_decl): Convert #ifdef GATHER_STATISTICS
to if-code.
(cxx_dup_lang_specific_decl): Likewise.
(copy_lang_type): Likewise.
(cxx_make_type): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189803 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 74 |
1 files changed, 36 insertions, 38 deletions
diff --git a/gcc/tree.c b/gcc/tree.c index f54e89060a5..4fea005a525 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -121,7 +121,6 @@ const char *const tree_code_class_strings[] = /* obstack.[ch] explicitly declined to prototype this. */ extern int _obstack_allocated_p (struct obstack *h, void *obj); -#ifdef GATHER_STATISTICS /* Statistics-gathering stuff. */ static int tree_code_counts[MAX_TREE_CODES]; @@ -147,7 +146,6 @@ static const char * const tree_node_kind_names[] = { "lang_type kinds", "omp clauses", }; -#endif /* GATHER_STATISTICS */ /* Unique id for next decl created. */ static GTY(()) int next_decl_uid; @@ -751,10 +749,12 @@ static void record_node_allocation_statistics (enum tree_code code ATTRIBUTE_UNUSED, size_t length ATTRIBUTE_UNUSED) { -#ifdef GATHER_STATISTICS enum tree_code_class type = TREE_CODE_CLASS (code); tree_node_kind kind; + if (!GATHER_STATISTICS) + return; + switch (type) { case tcc_declaration: /* A decl node */ @@ -832,7 +832,6 @@ record_node_allocation_statistics (enum tree_code code ATTRIBUTE_UNUSED, tree_code_counts[(int) code]++; tree_node_counts[(int) kind]++; tree_node_sizes[(int) kind] += length; -#endif } /* Allocate and return a new UID from the DECL_UID namespace. */ @@ -6337,11 +6336,12 @@ type_hash_canon (unsigned int hashcode, tree type) t1 = type_hash_lookup (hashcode, type); if (t1 != 0) { -#ifdef GATHER_STATISTICS - tree_code_counts[(int) TREE_CODE (type)]--; - tree_node_counts[(int) t_kind]--; - tree_node_sizes[(int) t_kind] -= sizeof (struct tree_type_non_common); -#endif + if (GATHER_STATISTICS) + { + tree_code_counts[(int) TREE_CODE (type)]--; + tree_node_counts[(int) t_kind]--; + tree_node_sizes[(int) t_kind] -= sizeof (struct tree_type_non_common); + } return t1; } else @@ -8709,36 +8709,34 @@ get_callee_fndecl (const_tree call) void dump_tree_statistics (void) { -#ifdef GATHER_STATISTICS - int i; - int total_nodes, total_bytes; -#endif + if (GATHER_STATISTICS) + { + int i; + int total_nodes, total_bytes; + fprintf (stderr, "Kind Nodes Bytes\n"); + fprintf (stderr, "---------------------------------------\n"); + total_nodes = total_bytes = 0; + for (i = 0; i < (int) all_kinds; i++) + { + fprintf (stderr, "%-20s %7d %10d\n", tree_node_kind_names[i], + tree_node_counts[i], tree_node_sizes[i]); + total_nodes += tree_node_counts[i]; + total_bytes += tree_node_sizes[i]; + } + fprintf (stderr, "---------------------------------------\n"); + fprintf (stderr, "%-20s %7d %10d\n", "Total", total_nodes, total_bytes); + fprintf (stderr, "---------------------------------------\n"); + fprintf (stderr, "Code Nodes\n"); + fprintf (stderr, "----------------------------\n"); + for (i = 0; i < (int) MAX_TREE_CODES; i++) + fprintf (stderr, "%-20s %7d\n", tree_code_name[i], tree_code_counts[i]); + fprintf (stderr, "----------------------------\n"); + ssanames_print_statistics (); + phinodes_print_statistics (); + } + else + fprintf (stderr, "(No per-node statistics)\n"); - fprintf (stderr, "\n??? tree nodes created\n\n"); -#ifdef GATHER_STATISTICS - fprintf (stderr, "Kind Nodes Bytes\n"); - fprintf (stderr, "---------------------------------------\n"); - total_nodes = total_bytes = 0; - for (i = 0; i < (int) all_kinds; i++) - { - fprintf (stderr, "%-20s %7d %10d\n", tree_node_kind_names[i], - tree_node_counts[i], tree_node_sizes[i]); - total_nodes += tree_node_counts[i]; - total_bytes += tree_node_sizes[i]; - } - fprintf (stderr, "---------------------------------------\n"); - fprintf (stderr, "%-20s %7d %10d\n", "Total", total_nodes, total_bytes); - fprintf (stderr, "---------------------------------------\n"); - fprintf (stderr, "Code Nodes\n"); - fprintf (stderr, "----------------------------\n"); - for (i = 0; i < (int) MAX_TREE_CODES; i++) - fprintf (stderr, "%-20s %7d\n", tree_code_name[i], tree_code_counts[i]); - fprintf (stderr, "----------------------------\n"); - ssanames_print_statistics (); - phinodes_print_statistics (); -#else - fprintf (stderr, "(No per-node statistics)\n"); -#endif print_type_hash_statistics (); print_debug_expr_statistics (); print_value_expr_statistics (); |