This is the mail archive of the gcc-regression@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]

A recent patch increased GCC's memory consumption!


Hi,

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

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


comparing empty function compilation at -O0 level:
    Overall memory needed: 8331k
    Peak memory use before GGC: 3393k
    Peak memory use after GGC: 3040k
    Maximum of released memory in single GGC run: 353k
    Garbage: 525k
    Leak: 3794k
    Overhead: 914k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 8347k
    Peak memory use before GGC: 3420k
    Peak memory use after GGC: 3068k
    Maximum of released memory in single GGC run: 352k
    Garbage: 527k
    Leak: 3827k
    Overhead: 918k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 8387k
    Peak memory use before GGC: 3393k
    Peak memory use after GGC: 3040k
    Maximum of released memory in single GGC run: 353k
    Garbage: 527k
    Leak: 3795k
    Overhead: 914k
    GGC runs: 3

comparing empty function compilation at -O2 level:
    Overall memory needed: 8391k
    Peak memory use before GGC: 3393k
    Peak memory use after GGC: 3041k
    Maximum of released memory in single GGC run: 352k
    Garbage: 531k
    Leak: 3796k
    Overhead: 915k
    GGC runs: 3

comparing empty function compilation at -O3 level:
    Overall memory needed: 8391k
    Peak memory use before GGC: 3393k
    Peak memory use after GGC: 3041k
    Maximum of released memory in single GGC run: 352k
    Garbage: 531k
    Leak: 3796k
    Overhead: 915k
    GGC runs: 3

comparing combine.c compilation at -O0 level:
    Overall memory needed: 23747k
    Peak memory use before GGC: 10320k
    Peak memory use after GGC: 9564k
    Maximum of released memory in single GGC run: 1903k
    Garbage: 39074k
    Leak: 8852k
    Overhead: 5785k
    GGC runs: 254

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 25619k
    Peak memory use before GGC: 11981k
    Peak memory use after GGC: 11356k
    Maximum of released memory in single GGC run: 1515k
    Garbage: 39436k
    Leak: 11746k
    Overhead: 6490k
    GGC runs: 250

comparing combine.c compilation at -O1 level:
  Amount of produced GGC garbage increased from 52208k to 52572k, overall 0.70%
  Amount of memory still referenced at the end of compilation increased from 8794k to 8991k, overall 2.24%
    Overall memory needed: 35671k -> 35707k
    Peak memory use before GGC: 18981k
    Peak memory use after GGC: 18791k
    Maximum of released memory in single GGC run: 1370k -> 1375k
    Garbage: 52208k -> 52572k
    Leak: 8794k -> 8991k
    Overhead: 6714k -> 6746k
    GGC runs: 320 -> 321

comparing combine.c compilation at -O2 level:
  Amount of produced GGC garbage increased from 70634k to 70971k, overall 0.48%
  Amount of memory still referenced at the end of compilation increased from 8941k to 9318k, overall 4.21%
    Overall memory needed: 37603k -> 37667k
    Peak memory use before GGC: 19035k
    Peak memory use after GGC: 18845k
    Maximum of released memory in single GGC run: 1404k -> 1410k
    Garbage: 70634k -> 70971k
    Leak: 8941k -> 9318k
    Overhead: 8829k -> 8862k
    GGC runs: 382 -> 383

comparing combine.c compilation at -O3 level:
  Amount of produced GGC garbage increased from 91871k to 92904k, overall 1.12%
  Amount of memory still referenced at the end of compilation increased from 9060k to 9430k, overall 4.09%
    Overall memory needed: 40375k -> 40587k
    Peak memory use before GGC: 19304k -> 19310k
    Peak memory use after GGC: 18958k -> 18962k
    Maximum of released memory in single GGC run: 2050k -> 2261k
    Garbage: 91871k -> 92904k
    Leak: 9060k -> 9430k
    Overhead: 11353k -> 11490k
    GGC runs: 412

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 140099k
    Peak memory use before GGC: 60577k
    Peak memory use after GGC: 34071k
    Maximum of released memory in single GGC run: 34143k
    Garbage: 132271k
    Leak: 11328k
    Overhead: 15587k
    GGC runs: 197

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 141351k
    Peak memory use before GGC: 61739k
    Peak memory use after GGC: 35232k
    Maximum of released memory in single GGC run: 34144k
    Garbage: 132245k
    Leak: 13291k
    Overhead: 15985k
    GGC runs: 199

comparing insn-attrtab.c compilation at -O1 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 58518k to 59098k, overall 0.99%
  Peak amount of GGC memory still allocated after garbage collecting increased from 52265k to 52847k, overall 1.11%
  Amount of produced GGC garbage increased from 211037k to 212964k, overall 0.91%
  Amount of memory still referenced at the end of compilation increased from 11397k to 12476k, overall 9.47%
    Overall memory needed: 150023k -> 150243k
    Peak memory use before GGC: 58518k -> 59098k
    Peak memory use after GGC: 52265k -> 52847k
    Maximum of released memory in single GGC run: 23476k -> 24232k
    Garbage: 211037k -> 212964k
    Leak: 11397k -> 12476k
    Overhead: 25411k -> 25581k
    GGC runs: 223 -> 222

comparing insn-attrtab.c compilation at -O2 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 58564k to 59720k, overall 1.97%
  Peak amount of GGC memory still allocated after garbage collecting increased from 53271k to 54426k, overall 2.17%
  Amount of produced GGC garbage increased from 250274k to 254073k, overall 1.52%
  Amount of memory still referenced at the end of compilation increased from 11406k to 13558k, overall 18.86%
    Overall memory needed: 189395k -> 188923k
    Peak memory use before GGC: 58564k -> 59720k
    Peak memory use after GGC: 53271k -> 54426k
    Maximum of released memory in single GGC run: 22130k -> 22887k
    Garbage: 250274k -> 254073k
    Leak: 11406k -> 13558k
    Overhead: 30974k -> 31304k
    GGC runs: 250 -> 249

comparing insn-attrtab.c compilation at -O3 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 69746k to 71703k, overall 2.81%
  Peak amount of GGC memory still allocated after garbage collecting increased from 63981k to 65136k, overall 1.81%
  Amount of produced GGC garbage increased from 277427k to 281242k, overall 1.38%
  Amount of memory still referenced at the end of compilation increased from 11417k to 13569k, overall 18.85%
    Overall memory needed: 194991k -> 195903k
    Peak memory use before GGC: 69746k -> 71703k
    Peak memory use after GGC: 63981k -> 65136k
    Maximum of released memory in single GGC run: 22568k -> 23330k
    Garbage: 277427k -> 281242k
    Leak: 11417k -> 13569k
    Overhead: 32772k -> 33103k
    GGC runs: 251 -> 252

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 156592k -> 156572k
    Peak memory use before GGC: 91614k -> 91635k
    Peak memory use after GGC: 90697k -> 90719k
    Maximum of released memory in single GGC run: 17978k -> 17984k
    Garbage: 210846k -> 210868k
    Leak: 55680k -> 55685k
    Overhead: 27052k -> 27054k
    GGC runs: 396

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 177720k -> 177760k
    Peak memory use before GGC: 104548k -> 104603k
    Peak memory use after GGC: 103510k -> 103559k
    Maximum of released memory in single GGC run: 18660k -> 18700k
    Garbage: 216706k -> 216728k
    Leak: 79109k -> 79114k
    Overhead: 33020k -> 33022k
    GGC runs: 373

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Amount of produced GGC garbage increased from 316846k to 318289k, overall 0.46%
  Amount of memory still referenced at the end of compilation increased from 54971k to 55572k, overall 1.09%
    Overall memory needed: 133320k -> 133368k
    Peak memory use before GGC: 93621k -> 93614k
    Peak memory use after GGC: 92690k -> 92687k
    Maximum of released memory in single GGC run: 17385k -> 17392k
    Garbage: 316846k -> 318289k
    Leak: 54971k -> 55572k
    Overhead: 32735k -> 32817k
    GGC runs: 497 -> 499

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 94130k to 94343k, overall 0.23%
  Peak amount of GGC memory still allocated after garbage collecting increased from 93194k to 93399k, overall 0.22%
  Amount of produced GGC garbage increased from 373719k to 375570k, overall 0.50%
  Amount of memory still referenced at the end of compilation increased from 55876k to 56796k, overall 1.65%
    Overall memory needed: 141964k -> 141796k
    Peak memory use before GGC: 94130k -> 94343k
    Peak memory use after GGC: 93194k -> 93399k
    Maximum of released memory in single GGC run: 17384k -> 17391k
    Garbage: 373719k -> 375570k
    Leak: 55876k -> 56796k
    Overhead: 39076k -> 39169k
    GGC runs: 557 -> 560

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Amount of memory still referenced at the end of compilation increased from 56286k to 57191k, overall 1.61%
    Overall memory needed: 146064k -> 145040k
    Peak memory use before GGC: 95144k -> 95154k
    Peak memory use after GGC: 94070k -> 94069k
    Maximum of released memory in single GGC run: 17801k -> 17808k
    Garbage: 415834k -> 415751k
    Leak: 56286k -> 57191k
    Overhead: 42628k -> 42468k
    GGC runs: 586 -> 587

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 381013k -> 381015k
    Peak memory use before GGC: 103474k
    Peak memory use after GGC: 59127k
    Maximum of released memory in single GGC run: 50583k
    Garbage: 179674k
    Leak: 9006k
    Overhead: 31653k
    GGC runs: 65

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 381829k -> 381827k
    Peak memory use before GGC: 104120k
    Peak memory use after GGC: 59774k
    Maximum of released memory in single GGC run: 50582k
    Garbage: 179778k
    Leak: 10775k
    Overhead: 32149k
    GGC runs: 72

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 289867k -> 290107k
    Peak memory use before GGC: 82781k
    Peak memory use after GGC: 75169k
    Maximum of released memory in single GGC run: 40017k
    Garbage: 236071k
    Leak: 18345k
    Overhead: 32718k
    GGC runs: 70

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 277899k -> 277559k
    Peak memory use before GGC: 80156k
    Peak memory use after GGC: 75170k
    Maximum of released memory in single GGC run: 33750k
    Garbage: 246134k
    Leak: 18433k
    Overhead: 34944k
    GGC runs: 83

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 1012663k -> 1012339k
    Peak memory use before GGC: 168797k
    Peak memory use after GGC: 158361k
    Maximum of released memory in single GGC run: 83495k
    Garbage: 356471k -> 356480k
    Leak: 28508k
    Overhead: 46898k -> 46898k
    GGC runs: 66

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-08-19 19:32:46.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-08-20 11:03:12.000000000 +0000
@@ -1,3 +1,141 @@
+2007-08-20  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+	PR middle-end/30564
+	* tree-inline.c (optimize_inline_calls): Move the cgraph checking
+	code in front of the compacting of basic blocks.
+	Move the folding of statements inbetween the cgraph checking
+	and compacting of basic blocks.
+
+2007-08-19  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+           Serge Belyshev  <belyshev@depni.sinp.msu.ru>
+
+	PR target/32522
+	* config/alpha/alpha.c (va_list_skip_additions): Check for
+	POINTER_PLUS_EXPR in addition to PLUS_EXPR.
+	(alpha_stdarg_optimize_hook): Look for POINTER_PLUS_EXPR instead of
+	PLUS_EXPR when checking ap.__base.
+	(alpha_va_start): Create POINTER_PLUS_EXPR instead of PLUS_EXPR
+	when doing addition on pointer types.  Use size_int instead of
+	build_int_cst.
+	(alpha_gimplify_va_arg_1): Likewise, but use sizetype instead of
+	ptr_type in the second operand.
+
+2007-08-19  Andrew Pinski  <pinskia@gmail.com>
+
+	PR target/33115
+	* config/i386/darwin.h (CC1_SPEC): Add %(cc1_cpu) in front.
+
+2007-08-19  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+	PR middle-end/32940
+	* cfgexpand.c  (expand_one_register_var): Mark pointer
+	DECL_ARTIFICIAL as REG_POINTER also.
+	* stmt.c (expand_decl): Likewise.
+
+2007-08-19  Daniel Berlin  <dberlin@dberlin.org>
+
+	Fix PR 32772
+	Fix PR 32716
+	Fix PR 32328
+	Fix PR 32303
+
+	* tree-flow.h (struct stmt_ann_d): Remove makes_clobbering_call.
+	* tree-ssa-alias.c (init_transitive_clobber_worklist): Add
+	on_worklist argument and avoid adding things to worklist multiple
+	times.
+	(add_to_worklist): Ditto.
+	(mark_aliases_call_clobbered): Mark entire structure clobbered if
+	single SFT is clobbered.
+	(set_initial_properties): Ditto.
+	(compute_call_clobbered): Update for changes to function
+	arguments.
+	(create_overlap_variables_for): Always create SFT for offset 0.
+	(create_structure_vars): Handle PHI's, since we are in SSA form at
+	this point.
+	* tree-ssa-loop-ivopts.c (get_ref_tag): Don't return subvars.
+	* tree-ssa-operands.c (access_can_touch_variable): Don't handle
+	TARGET_MEM_REF.
+	(add_vars_for_offset): Figure out aliases from access + points-to.
+	(add_virtual_operand): Use add_vars-for_offset.
+	(get_tmr_operands): Update for NMT changes, rewrite to be correct.
+	(add_call_clobber_ops): Remove makes_clobbering_call set.
+	(get_expr_operands): Always pass through the INDIRECT_REF
+	reference.
+	* tree-ssa-structalias.c (struct constraint_graph): Remove
+	variables member.
+	Add pe, pe_rep, pointer_label, loc_label, pointed_by, points_to,
+	address_taken, pt_used, number_incoming.
+	(FIRST_ADDR_NODE): Removed.
+	(merge_graph_nodes): Remove broken code for the moment.
+	(init_graph): New function.
+	(build_pred_graph): Remove code to init_graph.
+	Add location equivalence support.
+	(struct scc_info): Rename roots to deleted.
+	(scc_visit): Ditto.
+	(init_scc_info): Ditto
+	(init_topo_info): Use graph->size.
+	(compute_topo_order): Ditto.
+	(do_da_constraint): Removed.
+	(do_sd_constraint): Remove calls to find().
+	set_union_with_increment should always get 0 as last arg here.
+	(do_complex_constraint): Replace do_da_constraint with assert.
+	Stop calling find.
+	(struct equiv_class_label): New.
+	(pointer_equiv_class_table): Ditto.
+	(location_equiv_class_table): Ditto.
+	(equiv_class_label_hash): Ditto.
+	(equiv_class_label_eq): Ditto
+	(equiv_class_lookup): Ditto.
+	(equiv_class_ladd): Ditto.
+	(pointer_equiv_class): Ditto.
+	(location_equiv_class): Ditto.
+	(condense_visit): Rename and rewrite from label_visit to do only
+	SCC related stuff for HU.
+	(label_visit): Do HU work for HU.
+	(perform_var_substitution): Update to do HU and location
+	equivalence.
+	(free_var_substitution_info): Update to free HU and location
+	equivalence structures.  */
+	(find_equivalent_node): Update for pointer but not location
+	equivalence.
+	(unite_pointer_equivalences): New function.
+	(move_complex_constraints): Rewrite to only do moving.
+	(rewrite_constraints): Split out of move_complex_constraints.
+	(solve_graph): Use graph->size.
+	(process_constraint_1): Add from_call argument, use it.
+	Split *a = &b into two constraints.
+	(process_constraint): Use new process_constraint_1.
+	(get_constraint_for_component_ref): Handle bitmaxsize == -1 case.
+	(get_constraint_for): Handle non-pointer integers properly.
+	Remove code that used to handle structures.
+	(handle_ptr_arith): Fix a few bugs in pointer arithmetic handling
+	with unknown addends.
+	(handle_rhs_call): New function.
+	(find_func_aliases): Use handle_rhs_call.
+	(set_uids_in_ptset): Add an assert.
+	(set_used_smts): Fix bug in not considering unified vars.
+	(compute_tbaa_pruning): Stop initing useless iteration_obstack.
+	(compute_points_to_sets): Update for other function changes.
+	(delete_points_to_sets): Ditto.
+	(ipa_pta_execute): Ditto.
+	(pass_ipa_pta): We need to update SSA after ipa_pta.
+	
+2007-08-19  Jan Hubicka  <jh@suse.cz>
+
+	* i386.md: Replace "rim" and "mri" constraints by "g".
+
+2007-08-19  Joseph Myers  <joseph@codesourcery.com>
+
+	* dwarf2out.c (text_section_used, cold_text_section_used,
+	cold_text_section, dwarf2out_note_section_used): New.
+	(dwarf2out_init): Initialize cold_text_section.
+	(dwarf2out_switch_text_section, dwarf2out_begin_function): Call
+	dwarf2out_note_section_used.
+	(size_of_aranges): Only count entry for text section if it was
+	used.  Count entry for cold text section if it was used.
+	(output_aranges): Only output entries for text section and cold
+	text section if they were used.
+
 2007-08-19  Andrew Pinski  <pinskia@gmail.com>
 
 	* tree-pretty-print.c (debug_generic_expr): Add a comment about
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2007-08-18 12:29:36.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2007-08-20 11:03:11.000000000 +0000
@@ -1,3 +1,9 @@
+2007-08-20  Jakub Jelinek  <jakub@redhat.com>
+
+	PR c++/33025
+	* init.c (build_new_1): Rename placement_var variable to placement_expr.
+	Initialize it with save_expr rather than get_temp_regvar.
+
 2007-08-17  Andrew Pinski  <andrew_pinski@playstation.sony.com>
 
 	PR c++/28989


The results can be reproduced by building a 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.

Your testing script.


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