A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Thu Mar 1 15:21: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: 7384k -> 7383k
    Peak memory use before GGC: 2269k
    Peak memory use after GGC: 1958k
    Maximum of released memory in single GGC run: 311k
    Garbage: 446k
    Leak: 2292k
    Overhead: 456k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 7400k -> 7399k
    Peak memory use before GGC: 2297k
    Peak memory use after GGC: 1986k
    Maximum of released memory in single GGC run: 311k
    Garbage: 449k
    Leak: 2325k
    Overhead: 461k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 7512k -> 7515k
    Peak memory use before GGC: 2269k
    Peak memory use after GGC: 1958k
    Maximum of released memory in single GGC run: 311k
    Garbage: 452k
    Leak: 2295k
    Overhead: 457k
    GGC runs: 4

comparing empty function compilation at -O2 level:
    Overall memory needed: 7520k -> 7523k
    Peak memory use before GGC: 2270k
    Peak memory use after GGC: 1959k
    Maximum of released memory in single GGC run: 311k
    Garbage: 455k
    Leak: 2295k
    Overhead: 457k
    GGC runs: 4

comparing empty function compilation at -O3 level:
    Overall memory needed: 7520k -> 7523k
    Peak memory use before GGC: 2270k
    Peak memory use after GGC: 1959k
    Maximum of released memory in single GGC run: 311k
    Garbage: 455k
    Leak: 2295k
    Overhead: 457k
    GGC runs: 4

comparing combine.c compilation at -O0 level:
    Overall memory needed: 17848k -> 17847k
    Peak memory use before GGC: 9271k
    Peak memory use after GGC: 8859k -> 8858k
    Maximum of released memory in single GGC run: 2578k
    Garbage: 36907k -> 36923k
    Leak: 6587k -> 6587k
    Overhead: 5037k -> 5038k
    GGC runs: 279

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 19868k -> 19867k
    Peak memory use before GGC: 10887k
    Peak memory use after GGC: 10519k -> 10518k
    Maximum of released memory in single GGC run: 2355k -> 2354k
    Garbage: 37492k -> 37493k
    Leak: 9480k -> 9480k
    Overhead: 5743k -> 5743k
    GGC runs: 268

comparing combine.c compilation at -O1 level:
    Overall memory needed: 35284k -> 35291k
    Peak memory use before GGC: 19350k -> 19349k
    Peak memory use after GGC: 19135k -> 19134k
    Maximum of released memory in single GGC run: 2169k
    Garbage: 57238k -> 57237k
    Leak: 6616k -> 6616k
    Overhead: 6375k -> 6375k
    GGC runs: 350

comparing combine.c compilation at -O2 level:
    Overall memory needed: 37588k -> 37635k
    Peak memory use before GGC: 19387k -> 19386k
    Peak memory use after GGC: 19185k -> 19184k
    Maximum of released memory in single GGC run: 2157k -> 2156k
    Garbage: 68517k -> 68575k
    Leak: 6725k -> 6725k
    Overhead: 8001k -> 7999k
    GGC runs: 402 -> 404

comparing combine.c compilation at -O3 level:
    Overall memory needed: 47008k -> 47011k
    Peak memory use before GGC: 20423k
    Peak memory use after GGC: 19541k -> 19540k
    Maximum of released memory in single GGC run: 3147k -> 3134k
    Garbage: 101022k -> 101042k
    Leak: 6865k -> 6866k
    Overhead: 12243k -> 12242k
    GGC runs: 452 -> 451

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 102944k -> 102959k
    Peak memory use before GGC: 68633k
    Peak memory use after GGC: 44737k
    Maximum of released memory in single GGC run: 36429k
    Garbage: 129358k -> 129356k
    Leak: 9590k
    Overhead: 16801k -> 16801k
    GGC runs: 206 -> 207

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 104336k -> 104339k
    Peak memory use before GGC: 69795k
    Peak memory use after GGC: 46005k
    Maximum of released memory in single GGC run: 36430k
    Garbage: 130585k -> 130578k
    Leak: 11298k
    Overhead: 17198k -> 17199k
    GGC runs: 206

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 147608k -> 147591k
    Peak memory use before GGC: 85871k
    Peak memory use after GGC: 80078k
    Maximum of released memory in single GGC run: 32814k
    Garbage: 263559k -> 263555k
    Leak: 9410k
    Overhead: 27491k -> 27491k
    GGC runs: 225

comparing insn-attrtab.c compilation at -O2 level:
  Overall memory allocated via mmap and sbrk increased from 196484k to 200571k, overall 2.08%
    Overall memory needed: 196484k -> 200571k
    Peak memory use before GGC: 87187k
    Peak memory use after GGC: 80148k
    Maximum of released memory in single GGC run: 30016k
    Garbage: 300063k -> 300057k
    Leak: 9407k
    Overhead: 33191k -> 33191k
    GGC runs: 245

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 192592k -> 191219k
    Peak memory use before GGC: 87200k
    Peak memory use after GGC: 80161k
    Maximum of released memory in single GGC run: 30079k
    Garbage: 300728k -> 300723k
    Leak: 9412k
    Overhead: 33391k -> 33391k
    GGC runs: 245

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 147362k -> 147357k
    Peak memory use before GGC: 90250k
    Peak memory use after GGC: 89356k
    Maximum of released memory in single GGC run: 17775k
    Garbage: 207698k -> 207694k
    Leak: 49052k
    Overhead: 23534k -> 23533k
    GGC runs: 411

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 165170k -> 165161k
    Peak memory use before GGC: 102855k
    Peak memory use after GGC: 101837k -> 101836k
    Maximum of released memory in single GGC run: 18129k
    Garbage: 214180k -> 214214k
    Leak: 72366k
    Overhead: 29428k -> 29428k
    GGC runs: 383

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 141893k -> 141840k
    Peak memory use before GGC: 101823k -> 101824k
    Peak memory use after GGC: 100800k -> 100801k
    Maximum of released memory in single GGC run: 17237k -> 17236k
    Garbage: 344114k -> 344089k
    Leak: 49762k -> 49761k
    Overhead: 30049k -> 30048k
    GGC runs: 526 -> 527

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 143801k -> 143832k
    Peak memory use before GGC: 102489k -> 102492k
    Peak memory use after GGC: 101444k -> 101449k
    Maximum of released memory in single GGC run: 17234k -> 17233k
    Garbage: 372859k -> 372851k
    Leak: 50745k -> 50753k
    Overhead: 33995k -> 33992k
    GGC runs: 561

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 146393k -> 146400k
    Peak memory use before GGC: 104252k -> 104249k
    Peak memory use after GGC: 103218k -> 103216k
    Maximum of released memory in single GGC run: 17610k
    Garbage: 390252k -> 390177k
    Leak: 51037k -> 51037k
    Overhead: 35344k -> 35341k
    GGC runs: 571 -> 572

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 244620k -> 244619k
    Peak memory use before GGC: 80969k
    Peak memory use after GGC: 58708k
    Maximum of released memory in single GGC run: 44133k
    Garbage: 144295k
    Leak: 7619k
    Overhead: 24814k
    GGC runs: 79

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 245424k -> 245427k
    Peak memory use before GGC: 81615k
    Peak memory use after GGC: 59354k
    Maximum of released memory in single GGC run: 44123k
    Garbage: 144570k
    Leak: 9387k
    Overhead: 25310k
    GGC runs: 89

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 245212k -> 245059k
    Peak memory use before GGC: 85141k
    Peak memory use after GGC: 74853k
    Maximum of released memory in single GGC run: 36136k
    Garbage: 222588k
    Leak: 20863k
    Overhead: 30547k
    GGC runs: 81

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 498396k -> 498215k
    Peak memory use before GGC: 79840k
    Peak memory use after GGC: 74854k
    Maximum of released memory in single GGC run: 33438k
    Garbage: 229631k
    Leak: 20953k
    Overhead: 32629k
    GGC runs: 91

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 1187344k -> 1186827k
    Peak memory use before GGC: 201756k
    Peak memory use after GGC: 190218k
    Maximum of released memory in single GGC run: 80702k
    Garbage: 375646k
    Leak: 46318k
    Overhead: 49354k
    GGC runs: 70

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-02-28 20:36:04.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-03-01 13:18:19.000000000 +0000
@@ -1,3 +1,49 @@
+2007-03-01  Uros Bizjak  <ubizjak@gmail.com>
+
+	* config/i386/i386.c (ix86_modes_tieable_p): Fix typo, use also
+	size of mode1 to check for tieable modes in MMX case.
+
+2007-03-01  Richard Sandiford  <richard@codesourcery.com>
+
+	* Makefile.in (rtlanal.o): Depend on tree.h.
+	* rtl.h (offset_within_section_p, split_const): Declare.
+	* rtlanal.c: Include tree.h.
+	(offset_within_block_p): New function, taken from
+	mips_offset_within_object_p.
+	(split_const): New function, taken from mips_split_const.
+	* config/m68k/m68k-protos.h (m68k_illegitimate_symbolic_constant_p):
+	Declare.
+	* config/m68k/m68k.h (M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P): Define.
+	(CONSTANT_ADDRESS_P): Only accept legitimate constants.
+	(LEGITIMATE_CONSTANT_P): Check m68k_illegitimate_symbolic_constant_p.
+	* config/m68k/m68k.c (TARGET_CANNOT_FORCE_CONST_MEM): Define.
+	(m68k_illegitimate_symbolic_constant_p): New function.
+	* config/m68k/m68k.md (movsi): Remove misleading predicates.
+	If M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P and the source is a
+	symbolic constant that might be outside the symbol's section,
+	move the symbol first and then add the offset.
+	* config/m68k/uclinux.h (M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P):
+	Override.
+	* config/mips/mips.c (mips_split_const): Delete.
+	(mips_offset_within_object_p): Delete.
+	(mips_symbolic_constant_p): Use offset_within_section_p and
+	split_const instead of mips_offset_within_object_p and
+	mips_split_const.
+	(mips_cannot_force_const_mem, mips_const_insns, mips_unspec_address)
+	(mips_legitimize_const_move, print_operand_reloc)
+	(mips_dangerous_for_la25_p): Use split_const instead of
+	mips_split_const.
+
+2007-02-28  Eric Christopher  <echristo@apple.com>
+
+	* Makefile.in (install-include-dir): Don't rm -rf include.
+
+2007-02-28  Richard Guenther  <rguenther@suse.de>
+
+	PR middle-end/30364
+	* fold-const.c (fold_binary): Do not associate expressions
+	with more than one variable for integer types that do not wrap.
+
 2007-02-28  Sandra Loosemore  <sandra@codesourcery.com>
 
 	* builtins.c (fold_builtin_call_list, fold_builtin_call_valist):
@@ -29,7 +75,7 @@
 
 	* calls.c (emit_library_call_value_1): Handle partial registers
 	correctly when building up CALL_INSN_FUNCTION_USAGE.
-	
+
 2007-02-27  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
 	* pa/predicates.md (move_src_operand): Allow zero for mode.
@@ -167,7 +213,7 @@
 
 	* loop-iv.c (simplify_using_initial_values): Fix oversight in previous
 	change; avoid a memory leak when returning early.
-	
+
 2007-02-26  Mark Mitchell  <mark@codesourcery.com>
 
 	* c-decl.c (static_ctors): Move to c-common.c.
@@ -466,7 +512,7 @@
 2007-02-22  Ira Rosen  <irar@il.ibm.com>
 
 	PR tree-optimization/30843
-	* tree-vect-transform.c (vect_transform_loop): Remove strided scalar 
+	* tree-vect-transform.c (vect_transform_loop): Remove strided scalar
 	stores only after all the group is vectorized.
 
 2007-02-22  Dorit Nuzman  <dorit@il.ibm.com>


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