A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Sun Jun 19 09:54:00 GMT 2005


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 combine.c compilation at -O0 level:
    Overall memory needed: 24808k
    Peak memory use before GGC: 9672k
    Peak memory use after GGC: 9020k -> 9019k
    Maximum of released memory in single GGC run: 2793k
    Garbage: 42033k -> 42027k
    Leak: 6680k -> 6680k
    Overhead: 5768k -> 5768k
    GGC runs: 338 -> 337

comparing combine.c compilation at -O1 level:
    Overall memory needed: 16788k -> 16792k
    Peak memory use before GGC: 9128k
    Peak memory use after GGC: 8611k -> 8610k
    Maximum of released memory in single GGC run: 2140k -> 2139k
    Garbage: 64083k -> 64089k
    Leak: 7139k -> 7139k
    Overhead: 7971k -> 7972k
    GGC runs: 529 -> 530

comparing combine.c compilation at -O2 level:
    Overall memory needed: 24224k -> 24220k
    Peak memory use before GGC: 17658k
    Peak memory use after GGC: 17478k
    Maximum of released memory in single GGC run: 2510k
    Garbage: 86712k -> 86705k
    Leak: 7165k -> 7164k
    Overhead: 10985k -> 10985k
    GGC runs: 494

comparing combine.c compilation at -O3 level:
    Overall memory needed: 24704k
    Peak memory use before GGC: 17671k -> 17670k
    Peak memory use after GGC: 17478k
    Maximum of released memory in single GGC run: 3309k
    Garbage: 115789k -> 115789k
    Leak: 7277k -> 7260k
    Overhead: 14755k -> 14755k
    GGC runs: 542 -> 541

comparing insn-attrtab.c compilation at -O0 level:
  Amount of memory still referenced at the end of compilation increased from 11297k to 11537k, overall 2.12%
    Overall memory needed: 82968k
    Peak memory use before GGC: 70954k
    Peak memory use after GGC: 45262k -> 45261k
    Maximum of released memory in single GGC run: 37012k
    Garbage: 149824k -> 149563k
    Leak: 11297k -> 11537k
    Overhead: 18394k -> 18394k
    GGC runs: 270

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 98472k -> 98524k
    Peak memory use before GGC: 72976k
    Peak memory use after GGC: 62383k
    Maximum of released memory in single GGC run: 36548k
    Garbage: 293937k -> 293938k
    Leak: 11637k -> 11636k
    Overhead: 35880k -> 35881k
    GGC runs: 385

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 155108k -> 155104k
    Peak memory use before GGC: 116922k -> 116921k
    Peak memory use after GGC: 87330k
    Maximum of released memory in single GGC run: 33167k
    Garbage: 389355k -> 389356k
    Leak: 11497k -> 11496k
    Overhead: 47837k -> 47837k
    GGC runs: 309

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 155104k
    Peak memory use before GGC: 116924k -> 116923k
    Peak memory use after GGC: 87332k
    Maximum of released memory in single GGC run: 33167k
    Garbage: 390148k -> 390145k
    Leak: 11518k -> 11518k
    Overhead: 47960k -> 47960k
    GGC runs: 313

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 124844k
    Peak memory use before GGC: 100701k
    Peak memory use after GGC: 99702k
    Maximum of released memory in single GGC run: 21538k
    Garbage: 230966k -> 230964k
    Leak: 53173k -> 53173k
    Overhead: 40190k -> 40189k
    GGC runs: 337

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 119228k
    Peak memory use before GGC: 110047k -> 110046k
    Peak memory use after GGC: 98627k
    Maximum of released memory in single GGC run: 19969k
    Garbage: 654200k -> 654206k
    Leak: 58443k -> 58442k
    Overhead: 89182k -> 89182k
    GGC runs: 510 -> 509

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 119228k
    Peak memory use before GGC: 110047k
    Peak memory use after GGC: 98628k -> 98627k
    Maximum of released memory in single GGC run: 19969k
    Garbage: 748376k -> 748381k
    Leak: 59327k -> 59328k
    Overhead: 106868k -> 106874k
    GGC runs: 590

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 121852k
    Peak memory use before GGC: 112791k -> 112790k
    Peak memory use after GGC: 100133k -> 100132k
    Maximum of released memory in single GGC run: 21328k -> 21327k
    Garbage: 807157k -> 807168k
    Leak: 60513k -> 60513k
    Overhead: 114507k -> 114507k
    GGC runs: 594

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2005-06-19 07:34:20.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2005-06-19 08:50:44.000000000 +0000
@@ -1,3 +1,11 @@
+2005-06-19  Uros Bizjak  <uros@kss-loka.si>
+
+	* config/i386/i386.c (ix86_function_arg_regno_p): Add MMX_REGNO_P
+	for TARGET_MMX.  Use MMX_REGPARM_MAX and SSE_REGPARM_MAX for MMX
+	and SSE registers to determine if regno is valid.
+	(ix86_function_value_regno_p): Depend FIRST_FLOAT_REG on
+	TARGET_FLOAT_RETURNS_IN_80387 also for TARGET_64BIT. Clean up.
+
 2005-06-18  Richard Henderson  <rth@redhat.com>
 
 	* tree-complex.c (init_dont_simulate_again): Clear DONT_SIMULATE_AGAIN
@@ -114,9 +122,9 @@
 
 2005-06-17  Richard Henderson  <rth@redhat.com>
 
-        * tree-vect-transform.c (vect_do_peeling_for_loop_bound): Use
-        initialize_original_copy_tables and free_original_copy_tables.
-        (vect_do_peeling_for_alignment): Likewise.
+	* tree-vect-transform.c (vect_do_peeling_for_loop_bound): Use
+	initialize_original_copy_tables and free_original_copy_tables.
+	(vect_do_peeling_for_alignment): Likewise.
 
 2005-06-17  Pat Haugen  <pthaugen@us.ibm.com>
 
@@ -229,22 +237,22 @@
 	(function_arg): Likewise.
 
 2005-06-16  Paolo Bonzini  <bonzini@gnu.org>
-            Daniel Jacobowitz  <dan@codesourcery.com>
+	    Daniel Jacobowitz  <dan@codesourcery.com>
 	    Alan Modra <amodra.bigpond.net.au>
 
-        * configure.ac (gcc_version): Set near the beginning.
-        (as, ld, nm): Do not link in-tree tools.  Set gcc_cv_* if tools are
-        found in the tree.  Use gcc_AC_PROG to find the tools in the system.
-        (objdump): Do not look for it.
-        * Makefile.in (NM_FOR_TARGET): Point to ./nm
-        (ORIGINAL_AS_FOR_TARGET, ORIGINAL_LD_FOR_TARGET,
-        ORIGINAL_NM_FOR_TARGET): Substitute from autoconf.
-        (as, ld, nm): New rules.
-        (libgcc.mk): Depend on them.
-        * aclocal.m4 (gcc_AC_TOOL_DIRS, gcc_AC_CHECK_TOOL,
-        gcc_AC_BUILD_EXEEXT): New.
-        (gcc_AC_CHECK_PROG_VER): Use gcc_AC_BUILD_EXEEXT.
-        * configure: Regenerate.
+	* configure.ac (gcc_version): Set near the beginning.
+	(as, ld, nm): Do not link in-tree tools.  Set gcc_cv_* if tools are
+	found in the tree.  Use gcc_AC_PROG to find the tools in the system.
+	(objdump): Do not look for it.
+	* Makefile.in (NM_FOR_TARGET): Point to ./nm
+	(ORIGINAL_AS_FOR_TARGET, ORIGINAL_LD_FOR_TARGET,
+	ORIGINAL_NM_FOR_TARGET): Substitute from autoconf.
+	(as, ld, nm): New rules.
+	(libgcc.mk): Depend on them.
+	* aclocal.m4 (gcc_AC_TOOL_DIRS, gcc_AC_CHECK_TOOL,
+	gcc_AC_BUILD_EXEEXT): New.
+	(gcc_AC_CHECK_PROG_VER): Use gcc_AC_BUILD_EXEEXT.
+	* configure: Regenerate.
 
 2005-06-16  Jan Hubicka  <jh@suse.cz>
 
@@ -380,7 +388,7 @@
 	
 2005-06-15  Richard Sandiford  <richard@codesourcery.com>
 
-        * doc/invoke.texi (-mips16): Fix typo.
+	* doc/invoke.texi (-mips16): Fix typo.
 
 2005-06-15  David Ung  <davidu@mips.com>
 
@@ -394,7 +402,7 @@
 	mips16e seb/seh. 
 	(*extend<SHORT:mode><GPR:mode>2): Disable this pattern for
 	GENERATE_MIPS16E. 
-        * doc/invoke.texi (MIPS Options): Add comment to -mips16
+	* doc/invoke.texi (MIPS Options): Add comment to -mips16
 	indicating MIPS16e ASE is used if targetting for MIPS32 or MIPS64.
 	
 2005-06-15  Diego Novillo  <dnovillo@redhat.com>
@@ -896,18 +904,18 @@
 
 2005-06-08  Dale Johannesen  <dalej@apple.com>
 
-        * config/darwin.c (darwin_binds_local_p):  New.
-        * config/darwin-protos.h (darwin_binds_local_p):  Declare it.
-        * config/i386/i386.c (TARGET_BINDS_LOCAL_P):  Use it for TARGET_MACHO.
-        * config/rs6000/rs6000.c (rs6000_binds_local_p):  Remove.
-        (TARGET_BINDS_LOCAL_P):  Change it to darwin_binds_local_p.
+	* config/darwin.c (darwin_binds_local_p):  New.
+	* config/darwin-protos.h (darwin_binds_local_p):  Declare it.
+	* config/i386/i386.c (TARGET_BINDS_LOCAL_P):  Use it for TARGET_MACHO.
+	* config/rs6000/rs6000.c (rs6000_binds_local_p):  Remove.
+	(TARGET_BINDS_LOCAL_P):  Change it to darwin_binds_local_p.
 
 2005-06-08  Aldy Hernandez  <aldyh@redhat.com>
 
-        * config/rs6000/rs6000.h: Remove rs6000_long_double_size_string,
-        rs6000_isel, rs6000_spe, rs6000_alignment_string,
-        rs6000_sched_restricted_insns_priority_str,
-        rs6000_sched_restricted_insns_priority, rs6000_abi_string.
+	* config/rs6000/rs6000.h: Remove rs6000_long_double_size_string,
+	rs6000_isel, rs6000_spe, rs6000_alignment_string,
+	rs6000_sched_restricted_insns_priority_str,
+	rs6000_sched_restricted_insns_priority, rs6000_abi_string.
 
 2005-06-08  Zdenek Dvorak  <dvorakz@suse.cz>
 
@@ -999,7 +1007,7 @@
 2005-06-08  Richard Henderson  <rth@redhat.com>
 
 	PR target/21721
-        * config/ia64/ia64.c (emit_predicate_relation_info): Skip p0.
+	* config/ia64/ia64.c (emit_predicate_relation_info): Skip p0.
 
 2005-06-08  Eric Botcazou  <ebotcazou@libertysurf.fr>
 


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