A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Sat Jun 30 05:15: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: 8332k
    Peak memory use before GGC: 3324k
    Peak memory use after GGC: 2988k -> 2989k
    Maximum of released memory in single GGC run: 336k -> 335k
    Garbage: 490k
    Leak: 3720k -> 3721k
    Overhead: 874k -> 874k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 8348k
    Peak memory use before GGC: 3351k -> 3352k
    Peak memory use after GGC: 3016k
    Maximum of released memory in single GGC run: 335k -> 336k
    Garbage: 492k
    Leak: 3753k -> 3753k
    Overhead: 878k -> 878k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 8384k
    Peak memory use before GGC: 3324k
    Peak memory use after GGC: 2988k -> 2989k
    Maximum of released memory in single GGC run: 336k -> 335k
    Garbage: 495k
    Leak: 3723k -> 3723k
    Overhead: 874k -> 874k
    GGC runs: 3

comparing empty function compilation at -O2 level:
    Overall memory needed: 8396k
    Peak memory use before GGC: 3324k
    Peak memory use after GGC: 2988k -> 2989k
    Maximum of released memory in single GGC run: 336k -> 335k
    Garbage: 498k
    Leak: 3723k -> 3723k
    Overhead: 875k -> 875k
    GGC runs: 3

comparing empty function compilation at -O3 level:
    Overall memory needed: 8396k
    Peak memory use before GGC: 3324k
    Peak memory use after GGC: 2988k -> 2989k
    Maximum of released memory in single GGC run: 336k -> 335k
    Garbage: 498k
    Leak: 3723k -> 3723k
    Overhead: 875k -> 875k
    GGC runs: 3

comparing combine.c compilation at -O0 level:
    Overall memory needed: 23408k -> 23412k
    Peak memory use before GGC: 9987k -> 9970k
    Peak memory use after GGC: 9190k
    Maximum of released memory in single GGC run: 1907k
    Garbage: 38258k -> 38272k
    Leak: 8338k -> 8338k
    Overhead: 5338k -> 5338k
    GGC runs: 243

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 25296k
    Peak memory use before GGC: 11631k -> 11632k
    Peak memory use after GGC: 10975k -> 10976k
    Maximum of released memory in single GGC run: 1880k
    Garbage: 38624k -> 38622k
    Leak: 11231k -> 11231k
    Overhead: 6044k -> 6044k
    GGC runs: 241

comparing combine.c compilation at -O1 level:
    Overall memory needed: 37096k -> 37100k
    Peak memory use before GGC: 18609k
    Peak memory use after GGC: 18407k -> 18408k
    Maximum of released memory in single GGC run: 1380k -> 1379k
    Garbage: 51719k -> 51750k
    Leak: 8393k -> 8394k
    Overhead: 6446k -> 6453k
    GGC runs: 317

comparing combine.c compilation at -O2 level:
  Amount of produced GGC garbage increased from 68465k to 68574k, overall 0.16%
    Overall memory needed: 39016k -> 39020k
    Peak memory use before GGC: 18653k -> 18650k
    Peak memory use after GGC: 18464k
    Maximum of released memory in single GGC run: 1355k -> 1356k
    Garbage: 68465k -> 68574k
    Leak: 8508k -> 8516k
    Overhead: 8578k -> 8601k
    GGC runs: 374 -> 375

comparing combine.c compilation at -O3 level:
  Amount of produced GGC garbage increased from 93723k to 93873k, overall 0.16%
    Overall memory needed: 44472k -> 44476k
    Peak memory use before GGC: 18803k
    Peak memory use after GGC: 18600k
    Maximum of released memory in single GGC run: 3718k
    Garbage: 93723k -> 93873k
    Leak: 8631k -> 8616k
    Overhead: 11867k -> 11897k
    GGC runs: 404 -> 405

comparing insn-attrtab.c compilation at -O0 level:
  Amount of produced GGC garbage increased from 131975k to 132231k, overall 0.19%
    Overall memory needed: 143072k
    Peak memory use before GGC: 60777k
    Peak memory use after GGC: 33783k
    Maximum of released memory in single GGC run: 34625k -> 34624k
    Garbage: 131975k -> 132231k
    Leak: 11182k -> 10943k
    Overhead: 14736k -> 14736k
    GGC runs: 186

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 144332k -> 144336k
    Peak memory use before GGC: 61939k
    Peak memory use after GGC: 34944k
    Maximum of released memory in single GGC run: 34626k -> 34625k
    Garbage: 132456k -> 132464k
    Leak: 12651k -> 12651k
    Overhead: 15133k -> 15133k
    GGC runs: 192

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 153504k
    Peak memory use before GGC: 59007k -> 59003k
    Peak memory use after GGC: 54782k
    Maximum of released memory in single GGC run: 23623k
    Garbage: 215850k -> 215940k
    Leak: 11068k -> 11069k
    Overhead: 25091k -> 25110k
    GGC runs: 217

comparing insn-attrtab.c compilation at -O2 level:
  Amount of produced GGC garbage increased from 248436k to 248912k, overall 0.19%
    Overall memory needed: 192028k -> 191892k
    Peak memory use before GGC: 58886k
    Peak memory use after GGC: 54871k
    Maximum of released memory in single GGC run: 21313k
    Garbage: 248436k -> 248912k
    Leak: 11058k -> 11058k
    Overhead: 30441k -> 30537k
    GGC runs: 240 -> 241

comparing insn-attrtab.c compilation at -O3 level:
  Amount of produced GGC garbage increased from 277485k to 277963k, overall 0.17%
    Overall memory needed: 197996k -> 197980k
    Peak memory use before GGC: 70104k -> 70105k
    Peak memory use after GGC: 65673k -> 65674k
    Maximum of released memory in single GGC run: 22922k
    Garbage: 277485k -> 277963k
    Leak: 11068k -> 11069k
    Overhead: 32160k -> 32256k
    GGC runs: 242 -> 243

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 154360k -> 154308k
    Peak memory use before GGC: 89846k -> 89847k
    Peak memory use after GGC: 88956k -> 88957k
    Maximum of released memory in single GGC run: 17977k -> 17978k
    Garbage: 208357k -> 208363k
    Leak: 52514k -> 52514k
    Overhead: 24545k -> 24545k
    GGC runs: 398

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 174644k
    Peak memory use before GGC: 102484k
    Peak memory use after GGC: 101469k
    Maximum of released memory in single GGC run: 18362k
    Garbage: 214036k -> 214034k
    Leak: 75824k -> 75824k
    Overhead: 30441k -> 30441k
    GGC runs: 373

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 150440k -> 150468k
    Peak memory use before GGC: 101405k -> 101407k
    Peak memory use after GGC: 100400k -> 100402k
    Maximum of released memory in single GGC run: 17434k
    Garbage: 339494k -> 339691k
    Leak: 53497k -> 53505k
    Overhead: 31403k -> 31443k
    GGC runs: 514

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Amount of produced GGC garbage increased from 388855k to 389623k, overall 0.20%
    Overall memory needed: 158056k -> 158076k
    Peak memory use before GGC: 101777k -> 101781k
    Peak memory use after GGC: 100765k -> 100766k
    Maximum of released memory in single GGC run: 17434k
    Garbage: 388855k -> 389623k
    Leak: 53816k -> 53816k
    Overhead: 37142k -> 37289k
    GGC runs: 563

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Amount of produced GGC garbage increased from 422644k to 423283k, overall 0.15%
    Overall memory needed: 160576k -> 160540k
    Peak memory use before GGC: 103423k -> 103429k
    Peak memory use after GGC: 102384k
    Maximum of released memory in single GGC run: 17796k -> 17795k
    Garbage: 422644k -> 423283k
    Leak: 54530k -> 54530k
    Overhead: 39729k -> 39860k
    GGC runs: 586 -> 588

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 387572k -> 387576k
    Peak memory use before GGC: 103387k
    Peak memory use after GGC: 59041k
    Maximum of released memory in single GGC run: 50582k
    Garbage: 179405k
    Leak: 8877k -> 8878k
    Overhead: 31379k -> 31379k
    GGC runs: 64

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 388388k -> 388384k
    Peak memory use before GGC: 104033k -> 104034k
    Peak memory use after GGC: 59687k
    Maximum of released memory in single GGC run: 50582k -> 50583k
    Garbage: 179510k -> 179558k
    Leak: 10645k -> 10646k
    Overhead: 31875k -> 31875k
    GGC runs: 72

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 311696k -> 311672k
    Peak memory use before GGC: 84351k
    Peak memory use after GGC: 75888k
    Maximum of released memory in single GGC run: 39401k
    Garbage: 232479k
    Leak: 22313k -> 22313k
    Overhead: 32107k -> 32107k
    GGC runs: 71

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 320016k -> 320080k
    Peak memory use before GGC: 80874k
    Peak memory use after GGC: 75888k
    Maximum of released memory in single GGC run: 33013k -> 33014k
    Garbage: 240662k -> 240669k
    Leak: 22392k -> 22393k
    Overhead: 34406k -> 34408k
    GGC runs: 83

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 1032492k -> 1032352k
    Peak memory use before GGC: 184628k
    Peak memory use after GGC: 172144k
    Maximum of released memory in single GGC run: 80995k
    Garbage: 349089k
    Leak: 47771k -> 47771k
    Overhead: 45251k -> 45251k
    GGC runs: 66

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-06-29 11:48:11.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-06-30 03:09:31.000000000 +0000
@@ -1,3 +1,33 @@
+2007-06-29  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+	PR middle-end/30024
+	* emit-rtl.c (init_emit_once): Intilize const_tiny_rtx[0]
+	for complex modes (both int and real).
+
+2007-06-29  Jan Hubicka  <jh@suse.cz>
+
+	* cse.c: Rever accidentally comitted TODO_verify_rtl_sharing change.
+
+2007-06-29  Jan Hubicka  <jh@suse.cz>
+
+	PR middle-end/32372
+	* cse.c (cse_insn): Avoid invalid sharing in between register note and
+	the insn pattern.
+
+2007-06-29  Anatoly Sokolov <aesok@post.ru>
+
+	PR target/32335
+	* config/avr/avr.c: Include dataflow header file.
+	(expand_prologue): Adjust for prologue insn change.
+	* config/avr/avr.md (call_prologue_saves): Only modify REG_SP once
+	inside a insn.
+
+2007-06-29  Richard Guenther  <rguenther@suse.de>
+
+	PR middle-end/32493
+	* gimplify.c (gimplify_call_expr): Ignore variable argument parts
+	during type verification.
+
 2007-06-29  Jan Hubicka  <jh@suse.cz>
 
 	* recog.c (validate_change_rtx_1): Unshare TO argument.
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2007-06-29 11:48:10.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2007-06-30 03:09:30.000000000 +0000
@@ -1,3 +1,9 @@
+2007-06-29  Douglas Gregor  <doug.gregor@gmail.com>
+
+	PR c++/31724
+	* init.c (build_new_1): Use structural equality on the copy of the
+	array type.
+
 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
 
 	* decl2.c (determine_visibility): Implement


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