A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Sat Jul 21 07:32: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: 3384k
    Peak memory use after GGC: 3031k
    Maximum of released memory in single GGC run: 353k
    Garbage: 525k
    Leak: 3783k
    Overhead: 912k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 8348k
    Peak memory use before GGC: 3411k
    Peak memory use after GGC: 3059k
    Maximum of released memory in single GGC run: 352k
    Garbage: 527k
    Leak: 3816k
    Overhead: 916k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 8388k
    Peak memory use before GGC: 3384k
    Peak memory use after GGC: 3031k
    Maximum of released memory in single GGC run: 353k
    Garbage: 530k
    Leak: 3786k
    Overhead: 913k
    GGC runs: 3

comparing empty function compilation at -O2 level:
    Overall memory needed: 8388k
    Peak memory use before GGC: 3384k
    Peak memory use after GGC: 3031k
    Maximum of released memory in single GGC run: 353k
    Garbage: 534k
    Leak: 3786k
    Overhead: 913k
    GGC runs: 3

comparing empty function compilation at -O3 level:
    Overall memory needed: 8388k
    Peak memory use before GGC: 3384k
    Peak memory use after GGC: 3031k
    Maximum of released memory in single GGC run: 353k
    Garbage: 534k
    Leak: 3786k
    Overhead: 913k
    GGC runs: 3

comparing combine.c compilation at -O0 level:
    Overall memory needed: 23836k -> 23824k
    Peak memory use before GGC: 10323k -> 10322k
    Peak memory use after GGC: 9553k
    Maximum of released memory in single GGC run: 1905k
    Garbage: 39084k -> 39079k
    Leak: 8840k
    Overhead: 5685k
    GGC runs: 254

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 25704k -> 25700k
    Peak memory use before GGC: 11987k -> 11985k
    Peak memory use after GGC: 11345k
    Maximum of released memory in single GGC run: 1516k
    Garbage: 39408k -> 39431k
    Leak: 11733k
    Overhead: 6390k -> 6391k
    GGC runs: 250

comparing combine.c compilation at -O1 level:
    Overall memory needed: 37564k
    Peak memory use before GGC: 18980k
    Peak memory use after GGC: 18789k
    Maximum of released memory in single GGC run: 1370k
    Garbage: 53267k -> 53256k
    Leak: 8896k
    Overhead: 6744k
    GGC runs: 326

comparing combine.c compilation at -O2 level:
    Overall memory needed: 39600k -> 39596k
    Peak memory use before GGC: 19034k
    Peak memory use after GGC: 18845k
    Maximum of released memory in single GGC run: 1403k
    Garbage: 71804k -> 71793k
    Leak: 9017k -> 9009k
    Overhead: 8877k -> 8877k
    GGC runs: 388

comparing combine.c compilation at -O3 level:
    Overall memory needed: 42236k -> 42208k
    Peak memory use before GGC: 19280k
    Peak memory use after GGC: 18972k
    Maximum of released memory in single GGC run: 2104k
    Garbage: 93378k -> 93365k
    Leak: 9135k
    Overhead: 11539k
    GGC runs: 418

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 143140k
    Peak memory use before GGC: 60811k
    Peak memory use after GGC: 34061k
    Maximum of released memory in single GGC run: 34384k
    Garbage: 132297k -> 132288k
    Leak: 11330k
    Overhead: 14974k -> 14974k
    GGC runs: 198

comparing insn-attrtab.c compilation at -O0 -g level:
  Amount of memory still referenced at the end of compilation increased from 13039k to 13055k, overall 0.12%
    Overall memory needed: 144412k -> 144420k
    Peak memory use before GGC: 61973k
    Peak memory use after GGC: 35222k
    Maximum of released memory in single GGC run: 34385k
    Garbage: 132510k -> 132498k
    Leak: 13039k -> 13055k
    Overhead: 15371k -> 15371k
    GGC runs: 201

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 154564k -> 154568k
    Peak memory use before GGC: 59309k
    Peak memory use after GGC: 55084k
    Maximum of released memory in single GGC run: 23586k
    Garbage: 217484k -> 217483k
    Leak: 11461k
    Overhead: 25167k
    GGC runs: 229

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 193600k -> 193608k
    Peak memory use before GGC: 59192k
    Peak memory use after GGC: 55145k
    Maximum of released memory in single GGC run: 21338k
    Garbage: 253148k -> 253146k
    Leak: 11455k
    Overhead: 30630k
    GGC runs: 254

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 199220k -> 199216k
    Peak memory use before GGC: 71748k
    Peak memory use after GGC: 65980k
    Maximum of released memory in single GGC run: 22952k -> 22951k
    Garbage: 282512k -> 282510k
    Leak: 11464k
    Overhead: 32426k
    GGC runs: 256

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 156807k -> 156739k
    Peak memory use before GGC: 91617k -> 91615k
    Peak memory use after GGC: 90698k -> 90697k
    Maximum of released memory in single GGC run: 18004k -> 18002k
    Garbage: 210834k -> 210807k
    Leak: 55669k -> 55669k
    Overhead: 26876k -> 26876k
    GGC runs: 397

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 177819k -> 177803k
    Peak memory use before GGC: 104506k -> 104505k
    Peak memory use after GGC: 103471k -> 103470k
    Maximum of released memory in single GGC run: 18640k -> 18639k
    Garbage: 216685k -> 216660k
    Leak: 79098k -> 79098k
    Overhead: 32844k -> 32844k
    GGC runs: 373

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 153462k -> 153430k
    Peak memory use before GGC: 103599k
    Peak memory use after GGC: 102500k
    Maximum of released memory in single GGC run: 17401k -> 17399k
    Garbage: 332906k -> 332873k
    Leak: 55778k
    Overhead: 33932k -> 33932k
    GGC runs: 500

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 164142k -> 164250k
    Peak memory use before GGC: 104172k -> 104177k
    Peak memory use after GGC: 103138k -> 103144k
    Maximum of released memory in single GGC run: 17401k -> 17399k
    Garbage: 389203k -> 389348k
    Leak: 56466k -> 56466k
    Overhead: 40157k -> 40191k
    GGC runs: 557

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 168950k -> 168958k
    Peak memory use before GGC: 106512k
    Peak memory use after GGC: 105430k
    Maximum of released memory in single GGC run: 17829k -> 17828k
    Garbage: 432649k -> 432784k
    Leak: 57183k -> 57192k
    Overhead: 43791k -> 43794k
    GGC runs: 583

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 387677k
    Peak memory use before GGC: 103464k
    Peak memory use after GGC: 59118k
    Maximum of released memory in single GGC run: 50582k
    Garbage: 179673k
    Leak: 8995k
    Overhead: 31651k
    GGC runs: 65

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 388489k
    Peak memory use before GGC: 104111k
    Peak memory use after GGC: 59764k
    Maximum of released memory in single GGC run: 50583k
    Garbage: 179778k
    Leak: 10763k
    Overhead: 32146k
    GGC runs: 72

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 306568k -> 306724k
    Peak memory use before GGC: 84311k
    Peak memory use after GGC: 75963k
    Maximum of released memory in single GGC run: 39284k
    Garbage: 232739k
    Leak: 22614k
    Overhead: 32720k
    GGC runs: 71

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 314780k
    Peak memory use before GGC: 80949k
    Peak memory use after GGC: 75963k
    Maximum of released memory in single GGC run: 33017k
    Garbage: 242836k
    Leak: 22696k
    Overhead: 34951k
    GGC runs: 85

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 1031832k -> 1031836k
    Peak memory use before GGC: 184703k
    Peak memory use after GGC: 172219k
    Maximum of released memory in single GGC run: 80994k
    Garbage: 349837k
    Leak: 48694k
    Overhead: 47426k
    GGC runs: 67

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-07-20 12:26:08.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-07-21 05:25:46.000000000 +0000
@@ -1,3 +1,38 @@
+2007-07-20  Richard Guenther  <rguenther@suse.de>
+
+	* tree-cfg.c (verify_expr): COND_EXPRs can have any
+	integral typed condition.
+	* tree-ssa.c (useless_type_conversion_p): Do not preserve
+	booleanness.  Only preserve conversions from a non-base
+	type to a base type, not in general between types with
+	different TYPE_MIN_VALUE or TYPE_MAX_VALUE.
+	* tree.def (COND_EXPR): Document that the condition
+	can be of any integral type.
+
+2007-07-20  Nigel Stephens  <nigel@mips.com>
+	    Richard Sandiford  <richard@codesourcery.com>
+
+	* config/mips/mips.h (mips_dwarf_regno): Declare.
+	(DBX_REGISTER_NUMBER): Remove redundant brackets.
+	(HI_REGNUM, LO_REGNUM): Define in an endian-dependent way.
+	(AC1HI_REGNUM, AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM)
+	(AC3HI_REGNUM, AC3LO_REGNUM, ACC_HI_REG_P): Delete.
+	(reg_class): Rename HI_REG to MD0_REG and LO_REG to MD1_REG.
+	(REG_CLASS_NAMES): Update accordingly.
+	* config/mips/mips.c (mips_dwarf_regno): New array.
+	(mips_regno_to_class): Rename HI_REG to MD0_REG and LO_REG to MD1_REG.
+	(mips_subword): Remove special handling for accumulator registers.
+	(override_options): Initiailize mips_dwarf_regno.  Remove use
+	of ACC_HI_REG_P.
+	(mips_swap_registers): New function.
+	(mips_conditional_register_usage): Swap accumulator registers
+	around if TARGET_LITTLE_ENDIAN.
+	(mips_cannot_change_mode_class): Remove special treatment of ACC_REGS.
+	* config/mips/constraints.md (h, l): Use the endianness to choose
+	between MD0_REG and MD1_REG.
+	* config/mips/mips.md (*mfhilo_<mode>_macc): Use a fixed-string,
+	alternative-dependent template.
+
 2007-07-20  Richard Sandiford  <richard@codesourcery.com>
 
 	* config/arm/arm.md (movsi): Use can_create_pseudo_p instead of


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