A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Mon Nov 26 21:42:00 GMT 2007


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: 6630k -> 6629k
    Peak memory use before GGC: 1095k
    Peak memory use after GGC: 993k
    Maximum of released memory in single GGC run: 129k
    Garbage: 237k
    Leak: 951k
    Overhead: 80k
    GGC runs: 2

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 6646k -> 6645k
    Peak memory use before GGC: 1122k
    Peak memory use after GGC: 1020k
    Maximum of released memory in single GGC run: 131k
    Garbage: 239k
    Leak: 983k
    Overhead: 84k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 6694k -> 6693k
    Peak memory use before GGC: 1095k
    Peak memory use after GGC: 993k
    Maximum of released memory in single GGC run: 131k
    Garbage: 239k
    Leak: 951k
    Overhead: 80k
    GGC runs: 2

comparing empty function compilation at -O2 level:
    Overall memory needed: 6710k -> 6709k
    Peak memory use before GGC: 1095k
    Peak memory use after GGC: 994k
    Maximum of released memory in single GGC run: 134k
    Garbage: 242k
    Leak: 952k
    Overhead: 81k
    GGC runs: 2

comparing empty function compilation at -O3 level:
    Overall memory needed: 6710k -> 6709k
    Peak memory use before GGC: 1095k
    Peak memory use after GGC: 994k
    Maximum of released memory in single GGC run: 134k
    Garbage: 242k
    Leak: 952k
    Overhead: 81k
    GGC runs: 2

comparing combine.c compilation at -O0 level:
    Overall memory needed: 21178k -> 21177k
    Peak memory use before GGC: 7806k
    Peak memory use after GGC: 7185k
    Maximum of released memory in single GGC run: 1550k
    Garbage: 37872k
    Leak: 5512k
    Overhead: 4577k
    GGC runs: 371

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 23182k -> 23181k
    Peak memory use before GGC: 9647k
    Peak memory use after GGC: 8953k
    Maximum of released memory in single GGC run: 1838k
    Garbage: 38232k
    Leak: 8317k
    Overhead: 5204k
    GGC runs: 342

comparing combine.c compilation at -O1 level:
    Overall memory needed: 31678k -> 31677k
    Peak memory use before GGC: 16359k
    Peak memory use after GGC: 16190k
    Maximum of released memory in single GGC run: 1367k
    Garbage: 51670k
    Leak: 5659k
    Overhead: 5719k
    GGC runs: 442

comparing combine.c compilation at -O2 level:
    Overall memory needed: 33566k -> 33561k
    Peak memory use before GGC: 16442k
    Peak memory use after GGC: 16278k
    Maximum of released memory in single GGC run: 1316k
    Garbage: 70989k
    Leak: 5989k
    Overhead: 8013k
    GGC runs: 510

comparing combine.c compilation at -O3 level:
    Overall memory needed: 37886k -> 37885k
    Peak memory use before GGC: 16664k
    Peak memory use after GGC: 16388k
    Maximum of released memory in single GGC run: 2119k
    Garbage: 92696k
    Leak: 6089k
    Overhead: 10592k
    GGC runs: 544

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 135922k -> 135921k
    Peak memory use before GGC: 56998k
    Peak memory use after GGC: 31455k
    Maximum of released memory in single GGC run: 33256k
    Garbage: 128179k
    Leak: 8380k
    Overhead: 13927k
    GGC runs: 292

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 137218k -> 137173k
    Peak memory use before GGC: 58140k
    Peak memory use after GGC: 32597k
    Maximum of released memory in single GGC run: 33256k
    Garbage: 128410k
    Leak: 10040k
    Overhead: 14283k
    GGC runs: 289

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 143186k -> 143185k
    Peak memory use before GGC: 56210k
    Peak memory use after GGC: 49982k
    Maximum of released memory in single GGC run: 23977k
    Garbage: 206550k
    Leak: 9274k
    Overhead: 23998k
    GGC runs: 315

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 186570k -> 186569k
    Peak memory use before GGC: 56849k
    Peak memory use after GGC: 51569k
    Maximum of released memory in single GGC run: 22720k
    Garbage: 247845k
    Leak: 10361k
    Overhead: 29741k
    GGC runs: 345

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 190998k -> 190997k
    Peak memory use before GGC: 68526k
    Peak memory use after GGC: 62279k
    Maximum of released memory in single GGC run: 23239k
    Garbage: 275919k
    Leak: 10398k
    Overhead: 31625k
    GGC runs: 350

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 147440k -> 147488k
    Peak memory use before GGC: 84523k
    Peak memory use after GGC: 83686k
    Maximum of released memory in single GGC run: 16844k
    Garbage: 202440k -> 202407k
    Leak: 48152k
    Overhead: 23847k -> 23847k
    GGC runs: 420

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 168260k
    Peak memory use before GGC: 96488k
    Peak memory use after GGC: 95531k
    Maximum of released memory in single GGC run: 17652k
    Garbage: 207964k -> 207935k
    Leak: 69765k
    Overhead: 28833k -> 28833k
    GGC runs: 392

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 122021k -> 122013k
    Peak memory use before GGC: 84530k
    Peak memory use after GGC: 83692k
    Maximum of released memory in single GGC run: 16330k
    Garbage: 294473k -> 294442k
    Leak: 47403k
    Overhead: 29147k -> 29146k
    GGC runs: 521

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 125013k -> 125021k
    Peak memory use before GGC: 84836k
    Peak memory use after GGC: 83921k
    Maximum of released memory in single GGC run: 16328k
    Garbage: 361910k -> 361882k
    Leak: 48337k
    Overhead: 36277k -> 36277k
    GGC runs: 593

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 85648k to 85954k, overall 0.36%
  Peak amount of GGC memory still allocated after garbage collecting increased from 84752k to 85102k, overall 0.41%
    Overall memory needed: 130497k -> 130505k
    Peak memory use before GGC: 85648k -> 85954k
    Peak memory use after GGC: 84752k -> 85102k
    Maximum of released memory in single GGC run: 16722k
    Garbage: 392855k -> 392852k
    Leak: 48864k
    Overhead: 38919k -> 38919k
    GGC runs: 620 -> 621

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 378591k -> 378595k
    Peak memory use before GGC: 101208k
    Peak memory use after GGC: 56862k
    Maximum of released memory in single GGC run: 50582k
    Garbage: 178902k
    Leak: 6097k
    Overhead: 30781k
    GGC runs: 106

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 379391k
    Peak memory use before GGC: 101839k
    Peak memory use after GGC: 57492k
    Maximum of released memory in single GGC run: 50583k
    Garbage: 179007k
    Leak: 7799k
    Overhead: 31213k
    GGC runs: 111

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 437490k -> 437741k
    Peak memory use before GGC: 78857k
    Peak memory use after GGC: 70436k
    Maximum of released memory in single GGC run: 37753k
    Garbage: 235356k
    Leak: 16073k
    Overhead: 35563k
    GGC runs: 105

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 357958k -> 358321k
    Peak memory use before GGC: 75422k
    Peak memory use after GGC: 70436k
    Maximum of released memory in single GGC run: 32245k
    Garbage: 246835k
    Leak: 16245k
    Overhead: 38881k
    GGC runs: 116

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 1312382k -> 1310989k
    Peak memory use before GGC: 136584k
    Peak memory use after GGC: 127941k
    Maximum of released memory in single GGC run: 59911k
    Garbage: 371405k
    Leak: 24376k
    Overhead: 48461k
    GGC runs: 103

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-11-26 14:01:20.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-11-26 19:21:29.000000000 +0000
@@ -1,3 +1,48 @@
+2007-11-26  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
+	
+	* c-common.c (conversion_warning): Use get_unwidened instead of
+	get_narrower.
+	
+2007-11-26  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
+
+	PR c/23722
+	* c-parser.c (struct c_parser): New bit in_if_block.
+	(c_parser_compound_statement_nostart): Handle unexpected 'else'
+	keyword.
+	(c_parser_statement_after_labels): Set in_if_block to false while
+	parsing.
+	(c_parser_if_body): Don't call c_parser_statement_after_labels if
+	a semicolon is found, just consume it. Don't call
+	c_parser_statement_after_labels if an open brace is found, call
+	c_parser_compound_statement instead.
+	(c_parser_else_body): New.
+	(c_parser_if_statement): Set in_if_block to true when parsing the
+	body of the 'if' statement. Use c_parser_else_body.
+
+2007-11-26  Andreas Krebbel  <krebbel1@de.ibm.com>
+
+	PR 34081/C++
+	* c-decl.c (store_parm_decls): Pass 'false' for the new
+	allocate_struct_function parameter.
+	* cgraphunit.c (cgraph_build_static_cdtor): Likewise.
+	* tree-parloops.c (create_loop_fn): Likewise.
+	* function.c (push_function_context_to, push_struct_function,
+	init_function_start): Likewise.
+	(allocate_struct_function): Add boolean parameter.
+	* tree.h (allocate_struct_function): Add boolean parameter.
+	* function.h (struct function): Move returns_struct and
+	returns_pcc_struct to the end of the structure definiton.
+
+2007-11-26  Uros Bizjak  <ubizjak@gmail.com>
+
+	PR target/34215
+	* config/i386/i386.md (truncdfsf2): Select SLOT_TEMP stack slot if
+	virtual registers are instantiated.
+	(truncxf<mode>2): Ditto.
+	(floatsi<mode>2): Ditto.
+	(floatdisf2): Ditto.
+	(floatdidf2): Ditto.
+
 2007-11-26  Rask Ingemann Lambertsen  <rask@sygehus.dk>
 
 	PR target/34174
@@ -66,8 +111,7 @@
 
 2007-11-25  Richard Guenther  <rguenther@suse.de>
 
-	* tree.h (struct tree_block): Move locus member next to
-	flags.
+	* tree.h (struct tree_block): Move locus member next to flags.
 	* c-decl.c (SCOPE_LIST_APPEND): Use BLOCK_CHAIN.
 	(SCOPE_LIST_CONCAT): Likewise.
 	(pop_scope): Likewise.
@@ -92,7 +136,7 @@
 	register that dies there.
 
 2007-11-23  Dirk Mueller  <dmueller@suse.de>
-	Richard Guenther <rguenther@suse.de>
+	    Richard Guenther <rguenther@suse.de>
 
 	PR middle-end/34197
 	* tree-vrp.c (check_array_ref): Move check for valid location..
@@ -105,7 +149,7 @@
 	outer_code.
 
 2007-11-23  Richard Guenther  <rguenther@suse.de>
-	Michael Matz  <matz@suse.de>
+	    Michael Matz  <matz@suse.de>
 
 	PR tree-optimization/34176
 	* alloc-pool.h (empty_alloc_pool): Declare.
@@ -119,11 +163,9 @@
 
 2007-11-23  Richard Guenther  <rguenther@suse.de>
 
-	* tree-ssa-copy.c (may_propagate_copy): Remove redundant
-	checks.
+	* tree-ssa-copy.c (may_propagate_copy): Remove redundant checks.
 	(merge_alias_info): Do verification only if checking is
-	enabled.  Merge flow-sensitive alias information in simple
-	cases.
+	enabled.  Merge flow-sensitive alias information in simple cases.
 	* tree-ssa-operands.c (get_addr_dereference_operands): Also
 	complain about missing NMTs.
 
@@ -160,8 +202,7 @@
 
 2007-11-22  Kaz Kojima  <kkojima@gcc.gnu.org>
 
-	* config/sh/sh.md (divsi_inv_m3): Handle zero dividend
-	specially.
+	* config/sh/sh.md (divsi_inv_m3): Handle zero dividend specially.
 
 2007-11-22  Uros Bizjak  <ubizjak@gmail.com>
 
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2007-11-25 16:44:09.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2007-11-26 19:21:28.000000000 +0000
@@ -1,3 +1,10 @@
+2007-11-26  Andreas Krebbel  <krebbel1@de.ibm.com>
+
+	PR 34081/C++
+	* decl.c (start_preparsed_function): Pass 
+	processing_template_decl for the new allocate_struct_function
+	parameter.
+
 2007-11-25  Richard Guenther  <rguenther@suse.de>
 
 	decl.c (poplevel): Use BLOCK_CHAIN.


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