A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Wed Nov 26 16:59:00 GMT 2008


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: 8209k
    Peak memory use before GGC: 1291k
    Peak memory use after GGC: 1217k
    Maximum of released memory in single GGC run: 134k
    Garbage: 218k
    Leak: 1221k
    Overhead: 136k
    GGC runs: 4
    Pre-IPA-Garbage: 207k
    Pre-IPA-Leak: 1224k
    Pre-IPA-Overhead: 135k
    Post-IPA-Garbage: 207k
    Post-IPA-Leak: 1224k
    Post-IPA-Overhead: 135k

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 8453k
    Peak memory use before GGC: 1319k
    Peak memory use after GGC: 1245k
    Maximum of released memory in single GGC run: 133k
    Garbage: 220k
    Leak: 1254k
    Overhead: 141k
    GGC runs: 4
    Pre-IPA-Garbage: 207k
    Pre-IPA-Leak: 1224k
    Pre-IPA-Overhead: 135k
    Post-IPA-Garbage: 207k
    Post-IPA-Leak: 1224k
    Post-IPA-Overhead: 135k

comparing empty function compilation at -O1 level:
    Overall memory needed: 8237k
    Peak memory use before GGC: 1291k
    Peak memory use after GGC: 1217k
    Maximum of released memory in single GGC run: 134k
    Garbage: 221k
    Leak: 1221k
    Overhead: 137k
    GGC runs: 4
    Pre-IPA-Garbage: 207k
    Pre-IPA-Leak: 1224k
    Pre-IPA-Overhead: 135k
    Post-IPA-Garbage: 207k
    Post-IPA-Leak: 1224k
    Post-IPA-Overhead: 135k

comparing empty function compilation at -O2 level:
    Overall memory needed: 8465k
    Peak memory use before GGC: 1291k
    Peak memory use after GGC: 1218k
    Maximum of released memory in single GGC run: 135k
    Garbage: 226k
    Leak: 1221k
    Overhead: 138k
    GGC runs: 4
    Pre-IPA-Garbage: 207k
    Pre-IPA-Leak: 1224k
    Pre-IPA-Overhead: 135k
    Post-IPA-Garbage: 207k
    Post-IPA-Leak: 1224k
    Post-IPA-Overhead: 135k

comparing empty function compilation at -O3 level:
    Overall memory needed: 8469k
    Peak memory use before GGC: 1291k
    Peak memory use after GGC: 1218k
    Maximum of released memory in single GGC run: 135k
    Garbage: 226k
    Leak: 1221k
    Overhead: 138k
    GGC runs: 4
    Pre-IPA-Garbage: 207k
    Pre-IPA-Leak: 1224k
    Pre-IPA-Overhead: 135k
    Post-IPA-Garbage: 207k
    Post-IPA-Leak: 1224k
    Post-IPA-Overhead: 135k

comparing combine.c compilation at -O0 level:
    Overall memory needed: 31989k
    Peak memory use before GGC: 18018k
    Peak memory use after GGC: 17801k
    Maximum of released memory in single GGC run: 1839k
    Garbage: 39406k
    Leak: 5800k
    Overhead: 5220k
    GGC runs: 337
    Pre-IPA-Garbage: 12408k
    Pre-IPA-Leak: 19349k
    Pre-IPA-Overhead: 2559k
    Post-IPA-Garbage: 12408k
    Post-IPA-Leak: 19349k
    Post-IPA-Overhead: 2559k

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 34009k
    Peak memory use before GGC: 19938k
    Peak memory use after GGC: 19657k
    Maximum of released memory in single GGC run: 1849k
    Garbage: 39703k
    Leak: 9082k
    Overhead: 6038k
    GGC runs: 321
    Pre-IPA-Garbage: 12507k
    Pre-IPA-Leak: 21623k
    Pre-IPA-Overhead: 3049k
    Post-IPA-Garbage: 12507k
    Post-IPA-Leak: 21623k
    Post-IPA-Overhead: 3049k

comparing combine.c compilation at -O1 level:
    Overall memory needed: 30621k -> 30709k
    Peak memory use before GGC: 15682k
    Peak memory use after GGC: 15507k
    Maximum of released memory in single GGC run: 1341k -> 1340k
    Garbage: 46800k -> 46802k
    Leak: 5780k -> 5780k
    Overhead: 6013k -> 6014k
    GGC runs: 402
    Pre-IPA-Garbage: 13147k
    Pre-IPA-Leak: 16845k
    Pre-IPA-Overhead: 2472k
    Post-IPA-Garbage: 13147k
    Post-IPA-Leak: 16845k
    Post-IPA-Overhead: 2472k

comparing combine.c compilation at -O2 level:
    Overall memory needed: 31285k -> 31141k
    Peak memory use before GGC: 15823k
    Peak memory use after GGC: 15660k
    Maximum of released memory in single GGC run: 1355k
    Garbage: 60479k -> 60502k
    Leak: 5809k -> 5809k
    Overhead: 8017k -> 8021k
    GGC runs: 468
    Pre-IPA-Garbage: 13310k
    Pre-IPA-Leak: 16927k
    Pre-IPA-Overhead: 2491k
    Post-IPA-Garbage: 13310k
    Post-IPA-Leak: 16927k
    Post-IPA-Overhead: 2491k

comparing combine.c compilation at -O3 level:
    Overall memory needed: 31913k -> 31929k
    Peak memory use before GGC: 15911k
    Peak memory use after GGC: 15752k
    Maximum of released memory in single GGC run: 1629k
    Garbage: 72899k -> 72936k
    Leak: 7136k -> 7136k
    Overhead: 9449k -> 9455k
    GGC runs: 496 -> 497
    Pre-IPA-Garbage: 13310k
    Pre-IPA-Leak: 16927k
    Pre-IPA-Overhead: 2491k
    Post-IPA-Garbage: 13310k
    Post-IPA-Leak: 16927k
    Post-IPA-Overhead: 2491k

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 155449k
    Peak memory use before GGC: 65230k
    Peak memory use after GGC: 53275k
    Maximum of released memory in single GGC run: 27424k
    Garbage: 130437k
    Leak: 8497k
    Overhead: 15723k
    GGC runs: 263
    Pre-IPA-Garbage: 38215k
    Pre-IPA-Leak: 55487k
    Pre-IPA-Overhead: 8223k
    Post-IPA-Garbage: 38215k
    Post-IPA-Leak: 55487k
    Post-IPA-Overhead: 8223k

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 156721k
    Peak memory use before GGC: 66504k
    Peak memory use after GGC: 54546k
    Maximum of released memory in single GGC run: 27425k
    Garbage: 130915k
    Leak: 10147k
    Overhead: 16179k
    GGC runs: 255
    Pre-IPA-Garbage: 38272k
    Pre-IPA-Leak: 57029k
    Pre-IPA-Overhead: 8558k
    Post-IPA-Garbage: 38272k
    Post-IPA-Leak: 57029k
    Post-IPA-Overhead: 8558k

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 133417k -> 133421k
    Peak memory use before GGC: 50200k
    Peak memory use after GGC: 43294k
    Maximum of released memory in single GGC run: 22951k
    Garbage: 180981k -> 180980k
    Leak: 7873k
    Overhead: 24529k -> 24528k
    GGC runs: 301
    Pre-IPA-Garbage: 43193k
    Pre-IPA-Leak: 43086k
    Pre-IPA-Overhead: 7642k
    Post-IPA-Garbage: 43193k
    Post-IPA-Leak: 43086k
    Post-IPA-Overhead: 7642k

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 148817k
    Peak memory use before GGC: 50204k
    Peak memory use after GGC: 45013k
    Maximum of released memory in single GGC run: 17964k
    Garbage: 204641k -> 204641k
    Leak: 15536k
    Overhead: 29999k -> 29999k
    GGC runs: 326
    Pre-IPA-Garbage: 43265k
    Pre-IPA-Leak: 43092k
    Pre-IPA-Overhead: 7651k
    Post-IPA-Garbage: 43265k
    Post-IPA-Leak: 43092k
    Post-IPA-Overhead: 7651k

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 162725k -> 162713k
    Peak memory use before GGC: 61826k
    Peak memory use after GGC: 58725k
    Maximum of released memory in single GGC run: 23617k
    Garbage: 242524k -> 242524k
    Leak: 7899k
    Overhead: 33465k -> 33465k
    GGC runs: 339
    Pre-IPA-Garbage: 43265k
    Pre-IPA-Leak: 43092k
    Pre-IPA-Overhead: 7651k
    Post-IPA-Garbage: 43265k
    Post-IPA-Leak: 43092k
    Post-IPA-Overhead: 7651k

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 151223k -> 151219k
    Peak memory use before GGC: 82979k
    Peak memory use after GGC: 82156k
    Maximum of released memory in single GGC run: 14701k
    Garbage: 205105k
    Leak: 52176k
    Overhead: 26930k
    GGC runs: 414
    Pre-IPA-Garbage: 111171k
    Pre-IPA-Leak: 88399k
    Pre-IPA-Overhead: 14825k
    Post-IPA-Garbage: 111171k
    Post-IPA-Leak: 88399k
    Post-IPA-Overhead: 14825k

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 169143k -> 169151k
    Peak memory use before GGC: 96605k
    Peak memory use after GGC: 95648k
    Maximum of released memory in single GGC run: 15130k
    Garbage: 210824k
    Leak: 78743k
    Overhead: 33595k
    GGC runs: 388
    Pre-IPA-Garbage: 111792k
    Pre-IPA-Leak: 104914k
    Pre-IPA-Overhead: 18328k
    Post-IPA-Garbage: 111792k
    Post-IPA-Leak: 104914k
    Post-IPA-Overhead: 18328k

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 111263k -> 111267k
    Peak memory use before GGC: 84260k
    Peak memory use after GGC: 83418k
    Maximum of released memory in single GGC run: 14981k
    Garbage: 282059k -> 282068k
    Leak: 49477k -> 49477k
    Overhead: 31619k -> 31619k
    GGC runs: 502
    Pre-IPA-Garbage: 159815k
    Pre-IPA-Leak: 88122k
    Pre-IPA-Overhead: 19891k
    Post-IPA-Garbage: 159815k
    Post-IPA-Leak: 88122k
    Post-IPA-Overhead: 19891k

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 112663k
    Peak memory use before GGC: 86021k
    Peak memory use after GGC: 85169k
    Maximum of released memory in single GGC run: 14964k
    Garbage: 338408k -> 338419k
    Leak: 49533k
    Overhead: 38385k -> 38394k
    GGC runs: 571
    Pre-IPA-Garbage: 163805k
    Pre-IPA-Leak: 88488k
    Pre-IPA-Overhead: 20369k
    Post-IPA-Garbage: 163805k
    Post-IPA-Leak: 88488k
    Post-IPA-Overhead: 20369k

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 113703k -> 113711k
    Peak memory use before GGC: 86641k
    Peak memory use after GGC: 85783k
    Maximum of released memory in single GGC run: 14964k
    Garbage: 370632k -> 370639k
    Leak: 49535k -> 49543k
    Overhead: 41726k -> 41721k
    GGC runs: 598
    Pre-IPA-Garbage: 163885k
    Pre-IPA-Leak: 89146k
    Pre-IPA-Overhead: 20421k
    Post-IPA-Garbage: 163885k
    Post-IPA-Leak: 89146k
    Post-IPA-Overhead: 20421k

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 361913k -> 361912k
    Peak memory use before GGC: 78518k
    Peak memory use after GGC: 49453k
    Maximum of released memory in single GGC run: 38186k
    Garbage: 144651k
    Leak: 7110k
    Overhead: 24889k
    GGC runs: 87
    Pre-IPA-Garbage: 12561k
    Pre-IPA-Leak: 20190k
    Pre-IPA-Overhead: 2241k
    Post-IPA-Garbage: 12561k
    Post-IPA-Leak: 20190k
    Post-IPA-Overhead: 2241k

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 362701k -> 362700k
    Peak memory use before GGC: 79215k
    Peak memory use after GGC: 50149k
    Maximum of released memory in single GGC run: 38170k
    Garbage: 144752k
    Leak: 9152k
    Overhead: 25473k
    GGC runs: 93
    Pre-IPA-Garbage: 12569k
    Pre-IPA-Leak: 20439k
    Pre-IPA-Overhead: 2295k
    Post-IPA-Garbage: 12569k
    Post-IPA-Leak: 20439k
    Post-IPA-Overhead: 2295k

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 227661k
    Peak memory use before GGC: 73624k
    Peak memory use after GGC: 66143k
    Maximum of released memory in single GGC run: 34735k
    Garbage: 222492k
    Leak: 7551k
    Overhead: 30652k
    GGC runs: 97
    Pre-IPA-Garbage: 48348k
    Pre-IPA-Leak: 63005k
    Pre-IPA-Overhead: 8797k
    Post-IPA-Garbage: 48348k
    Post-IPA-Leak: 63005k
    Post-IPA-Overhead: 8797k

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 358485k -> 358417k
    Peak memory use before GGC: 73624k
    Peak memory use after GGC: 66143k
    Maximum of released memory in single GGC run: 36061k
    Garbage: 251005k
    Leak: 7553k
    Overhead: 36772k
    GGC runs: 106
    Pre-IPA-Garbage: 107058k
    Pre-IPA-Leak: 75901k
    Pre-IPA-Overhead: 14919k
    Post-IPA-Garbage: 107058k
    Post-IPA-Leak: 75901k
    Post-IPA-Overhead: 14919k

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
  Amount of produced GGC garbage increased from 365514k to 366831k, overall 0.36%
    Overall memory needed: 1026609k -> 1027573k
    Peak memory use before GGC: 141898k
    Peak memory use after GGC: 129175k
    Maximum of released memory in single GGC run: 62763k
    Garbage: 365514k -> 366831k
    Leak: 9099k
    Overhead: 44902k -> 45135k
    GGC runs: 103
    Pre-IPA-Garbage: 107058k
    Pre-IPA-Leak: 75901k
    Pre-IPA-Overhead: 14919k
    Post-IPA-Garbage: 107058k
    Post-IPA-Leak: 75901k
    Post-IPA-Overhead: 14919k

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2008-11-25 20:54:40.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2008-11-26 13:29:03.000000000 +0000
@@ -1,3 +1,55 @@
+2008-11-26  Fredrik Unger  <fred@tree.se>
+
+	* config/soft-fp/floatuntisf.c (__floatuntisf): Correct
+	function name from __floatundisf.
+	* config/soft-fp/fixdfti.c (__fixdfti): Correct argument type to
+	DFtype.
+
+2008-11-25  Daniel Berlin  <dberlin@dberlin.org>
+	    Richard Guenther  <rguenther@suse.de>
+
+	PR tree-optimization/37869
+	* tree-ssa-structalias.c (struct constraint_graph): Remove
+	pt_used and number_incoming members.
+	(build_pred_graph): Do not allocate them.
+	(condense_visit): Do not use them.
+	(label_visit): Likewise.
+	(free_var_substitution_info): Do not free them.
+
+2008-11-25  Vladimir Makarov  <vmakarov@redhat.com>
+
+	* doc/invoke.texi (ira-max-loops-num): Change semantics.
+
+	* ira-int.h (struct ira_loop_tree_node): New member to_remove_p.
+
+	* ira-color.c (allocno_spill_priority): New function.
+	(remove_allocno_from_bucket_and_push, push_allocno_to_spill):
+	Print more info about the spilled allocno.
+	(push_allocnos_to_stack): Use allocno_spill_priority.  Add more
+	checks on bad spill.
+
+	* ira-build.c (loop_node_to_be_removed_p): Remove.
+	(loop_compare_func, mark_loops_for_removal): New functions.
+	(remove_uneccesary_loop_nodes_from_loop_t): Use member
+	to_remove_p.
+	(remove_unnecessary_allocnos): Call mark_loops_for_removal.
+
+	* ira.c (ira): Don't change flag_ira_algorithm.
+
+	* params.def (ira-max-loops-num): Change the value.
+
+2008-11-25  Maxim Kuvyrkov  <maxim@codesourcery.com>
+
+	* config/m68k/m68k.md (extendsidi2, extendsidi2_mem): Merge, clean up.
+	Disable unsupported alternative for ColdFire,
+	add new alternative that ColdFire can handle.
+
+2008-11-25  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* regrename.c (merge_overlapping_regs): Add registers artificially
+	defined at the top of the basic block to the set of live ones just
+	before the first insn.
+
 2008-11-25  H.J. Lu  <hongjiu.lu@intel.com>
 	    Joey Ye  <joey.ye@intel.com>
 
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2008-11-21 00:44:03.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2008-11-26 13:29:02.000000000 +0000
@@ -1,3 +1,9 @@
+2008-11-25  Jason Merrill  <jason@redhat.com>
+
+	PR c++/28743
+	* decl2.c (check_classfn): Error rather than abort on parameter
+	list mismatch.
+
 2008-11-20  Jason Merrill  <jason@redhat.com>
 
 	PR c++/28513


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.



More information about the Gcc-regression mailing list