GCC memory consumption increased by recent patch!

gcctest@suse.de gcctest@suse.de
Mon Sep 27 04:12:00 GMT 2004


Hi,
Comparing memory consumption on compilation of combine.i and generate-3.4.ii I got:


comparing combine.c compilation at -O0 level:
  Overall memory allocated via mmap and sbrk increased from 24121k to 24169k, overall 0.20%
    Overall memory needed: 24121k -> 24169k
    Peak memory use before GGC: 9296k
    Peak memory use after GGC: 8607k
    Maximum of released memory in single GGC run: 2870k
    Garbage: 42629k
    Leak: 6090k
    Overhead: 5588k
    GGC runs: 363

comparing combine.c compilation at -O1 level:
  Overall memory allocated via mmap and sbrk increased from 25585k to 25629k, overall 0.17%
    Overall memory needed: 25585k -> 25629k
    Peak memory use before GGC: 9377k
    Peak memory use after GGC: 8800k
    Maximum of released memory in single GGC run: 2031k
    Garbage: 69180k
    Leak: 6674k
    Overhead: 11094k
    GGC runs: 575

comparing combine.c compilation at -O2 level:
  Overall memory allocated via mmap and sbrk increased from 28885k to 28929k, overall 0.15%
    Overall memory needed: 28885k -> 28929k
    Peak memory use before GGC: 12772k
    Peak memory use after GGC: 12613k
    Maximum of released memory in single GGC run: 2525k
    Garbage: 84273k
    Leak: 6428k
    Overhead: 15636k
    GGC runs: 571

comparing combine.c compilation at -O3 level:
    Overall memory needed: 20544k
    Peak memory use before GGC: 13044k
    Peak memory use after GGC: 12692k
    Maximum of released memory in single GGC run: 3362k
    Garbage: 112175k
    Leak: 6929k
    Overhead: 20684k
    GGC runs: 637

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 116476k
    Peak memory use before GGC: 77101k
    Peak memory use after GGC: 45186k
    Maximum of released memory in single GGC run: 42129k
    Garbage: 159505k -> 159505k
    Leak: 10645k
    Overhead: 19805k -> 19805k
    GGC runs: 310

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 133084k
    Peak memory use before GGC: 93162k
    Peak memory use after GGC: 71529k
    Maximum of released memory in single GGC run: 41234k
    Garbage: 453085k -> 453085k
    Leak: 11078k
    Overhead: 73707k -> 73707k
    GGC runs: 461

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 207744k
    Peak memory use before GGC: 108725k
    Peak memory use after GGC: 87092k
    Maximum of released memory in single GGC run: 34490k
    Garbage: 502446k -> 502447k
    Leak: 11218k
    Overhead: 83073k -> 83073k
    GGC runs: 384

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 207736k
    Peak memory use before GGC: 108726k
    Peak memory use after GGC: 87093k
    Maximum of released memory in single GGC run: 34491k
    Garbage: 503617k -> 503617k
    Leak: 11256k
    Overhead: 83469k -> 83469k
    GGC runs: 393

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 115352k
    Peak memory use before GGC: 92231k
    Peak memory use after GGC: 90025k
    Maximum of released memory in single GGC run: 20139k
    Garbage: 265688k -> 265688k
    Leak: 60277k
    Overhead: 47198k -> 47198k
    GGC runs: 378

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 109320k -> 109352k
    Peak memory use before GGC: 95751k
    Peak memory use after GGC: 88883k
    Maximum of released memory in single GGC run: 19570k
    Garbage: 594441k -> 594412k
    Leak: 62357k
    Overhead: 131029k -> 131026k
    GGC runs: 605

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 110308k -> 110316k
    Peak memory use before GGC: 95751k
    Peak memory use after GGC: 88883k
    Maximum of released memory in single GGC run: 19569k
    Garbage: 647298k -> 647298k
    Leak: 62912k
    Overhead: 154283k -> 154285k
    GGC runs: 638

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 108024k -> 108016k
    Peak memory use before GGC: 91613k
    Peak memory use after GGC: 90197k
    Maximum of released memory in single GGC run: 20253k
    Garbage: 682712k -> 682715k
    Leak: 63333k
    Overhead: 163435k -> 163435k
    GGC runs: 626

Head of changelog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2004-09-26 18:52:33.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2004-09-27 00:57:09.000000000 +0000
@@ -1,3 +1,75 @@
+2004-09-26  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
+
+	* bitmap.h (EXECUTE_IF_SET_IN_BITMAP, EXECUTE_IF_AND_COMPL_IN_BITMAP,
+	EXECUTE_IF_AND_IN_BITMAP): Changed to iterator style.
+	(bitmap_iterator): New type.
+	(bmp_iter_common_next_1, bmp_iter_single_next_1, bmp_iter_single_init,
+	bmp_iter_end_p, bmp_iter_single_next, bmp_iter_and_not_next_1,
+	bmp_iter_and_not_init, bmp_iter_and_not_next, bmp_iter_and_next_1,
+	bmp_iter_and_init, bmp_iter_and_next): New functions.
+	* basic-block.h (EXECUTE_IF_SET_IN_REG_SET,
+	EXECUTE_IF_AND_COMPL_IN_REG_SET, EXECUTE_IF_AND_IN_REG_SET): Changed to
+	use iterator-style EXECUTE_IF_IN_BITMAP macros.
+	* bitmap.c (bitmap_print): Ditto.
+	* bt-load.c (clear_btr_from_live_range, add_btr_to_live_range,
+	btr_def_live_range): Ditto.
+	* cfganal.c (compute_dominance_frontiers_1) Ditto.
+	* cgraphunit.c (convert_UIDs_in_bitmap, cgraph_characterize_statics):
+	Ditto.
+	* ddg.c (build_inter_loop_deps): Ditto.
+	* df.c (FOR_EACH_BB_IN_BITMAP, df_bb_reg_info_compute, df_refs_update):
+	Ditto.
+	* except.c (remove_eh_handler): Ditto.
+	* flow.c (reg_set_to_hard_reg_set): Ditto.
+	* gcse.c (clear_modify_mem_tables): Ditto.
+	* global.c (build_insn_chain): Ditto.
+	* ifcvt.c (dead_or_predicable): Ditto.
+	* loop-invariant.c (get_inv_cost, set_move_mark, move_invariant_reg):
+	Ditto.
+	* ra-build.c (livethrough_conflicts_bb, conflicts_between_webs): Ditto.
+	* ra-rewrite.c (reloads_to_loads, rewrite_program2,
+	detect_web_parts_to_rebuild, delete_useless_defs, actual_spill): Ditto.
+	* tree-cfg.c (allocate_ssa_names, tree_duplicate_sese_region,
+	tree_purge_all_dead_eh_edges): Ditto.
+	* tree-into-ssa.c (compute_global_livein, insert_phi_nodes,
+	insert_phi_nodes_for, debug_def_blocks_r, invalidate_name_tags,
+	rewrite_ssa_into_ssa): Ditto.
+	* tree-outof-ssa.c (find_replaceable_exprs): Ditto.
+	* tree-sra.c (scan_function, decide_instantiations, scalarize_parms):
+	Ditto.
+	* tree-ssa-alias.c (init_alias_info, compute_points_to_and_addr_escape,
+	compute_flow_sensitive_aliasing, maybe_create_global_var,
+	dump_points_to_info_for): Ditto.
+	* tree-ssa-dce.c (EXECUTE_IF_CONTROL_DEPENDENT): Ditto.
+	* tree-ssa-dse.c (dse_finalize_block): Ditto.
+	* tree-ssa-live.c (live_worklist, calculate_live_on_entry,
+	calculate_live_on_exit, build_tree_conflict_graph, dump_live_info):
+	Ditto.
+	* tree-ssa-loop-ivopts.c (find_induction_variables,
+	find_interesting_uses, add_old_ivs_candidates, alloc_use_cost_map,
+	determine_use_iv_costs, determine_set_costs, find_best_candidate,
+	set_cost_up_to, create_new_ivs, remove_unused_ivs, free_loop_data):
+	Ditto.
+	* tree-ssa-loop-manip.c (add_exit_phis_var, add_exit_phis): Ditto.
+	* tree-ssa-operands.c (get_asm_expr_operands, add_call_clobber_ops,
+	add_call_read_ops): Ditto.
+	* tree-ssa-pre.c (bitmap_print_value_set, insert_aux): Ditto.
+
+2004-09-26  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+	* pa.c (print_operand): Use non-trapping completers for UNLE, UNLT,
+	UNGE, UNGT, UNEQ, UNORDERED and ORDERED comparisons.
+
+2004-09-26  Ulrich Weigand  <uweigand@de.ibm.com>
+
+	* builtins.c (expand_builtin_memcmp): Adjust MEM_SIZE to
+	reflect size of memory regions being compared.
+
+2004-09-26  Ulrich Weigand  <uweigand@de.ibm.com>
+
+	* builtins.c (get_memory_rtx): Set mem attributes for non-ADDR_EXPR
+	expressions.  Always clear MEM_SIZE and alias set.
+
 2004-09-26  Roger Sayle  <roger@eyesopen.com>
 	    Giovanni Bajo  <giovannibajo@gcc.gnu.org>
 

I am friendly script caring about memory consumption in GCC.  Please contact
jh@suse.cz if something is going wrong.

The results can be reproduced by building compiler with
--enable-gather-detailed-mem-stats targetting x86-64 and compiling preprocessed
combine.c or testcase from PR8632 with:

-fmem-report --param=ggc-min-heapsize=1024 --param=ggc-min-expand=1 -Ox -Q

The memory consumption summary appears in the dump after detailed listing of
the places they are allocated in.  Peak memory consumption is actually computed
by looking for maximal value in {GC XXXX -> YYYY} report.

Yours testing script.



More information about the Gcc-regression mailing list