A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Tue Jul 12 06:59: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: 24721k -> 24725k
    Peak memory use before GGC: 9591k
    Peak memory use after GGC: 8938k
    Maximum of released memory in single GGC run: 2754k
    Garbage: 41378k
    Leak: 6709k
    Overhead: 5842k
    GGC runs: 320

comparing combine.c compilation at -O1 level:
    Overall memory needed: 23924k
    Peak memory use before GGC: 17374k
    Peak memory use after GGC: 17181k
    Maximum of released memory in single GGC run: 2418k
    Garbage: 66036k -> 66037k
    Leak: 7173k
    Overhead: 7501k -> 7502k
    GGC runs: 412

comparing combine.c compilation at -O2 level:
    Overall memory needed: 23940k
    Peak memory use before GGC: 17380k
    Peak memory use after GGC: 17181k
    Maximum of released memory in single GGC run: 2500k
    Garbage: 84405k -> 84412k
    Leak: 7411k
    Overhead: 10034k -> 10035k
    GGC runs: 482

comparing combine.c compilation at -O3 level:
    Overall memory needed: 24440k
    Peak memory use before GGC: 17650k
    Peak memory use after GGC: 17262k
    Maximum of released memory in single GGC run: 3341k
    Garbage: 115606k -> 115636k
    Leak: 7484k
    Overhead: 13196k -> 13199k
    GGC runs: 533

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 81648k
    Peak memory use before GGC: 70268k
    Peak memory use after GGC: 45007k
    Maximum of released memory in single GGC run: 37046k
    Garbage: 149716k
    Leak: 11585k
    Overhead: 19128k
    GGC runs: 252

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 115556k -> 115560k
    Peak memory use before GGC: 98428k
    Peak memory use after GGC: 87786k
    Maximum of released memory in single GGC run: 32759k
    Garbage: 295301k -> 295302k
    Leak: 11547k
    Overhead: 35277k -> 35277k
    GGC runs: 283

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 129180k
    Peak memory use before GGC: 117531k
    Peak memory use after GGC: 87770k
    Maximum of released memory in single GGC run: 32441k
    Garbage: 381881k -> 381882k
    Leak: 11662k
    Overhead: 47146k -> 47146k
    GGC runs: 319

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 129188k -> 129184k
    Peak memory use before GGC: 117532k
    Peak memory use after GGC: 87771k
    Maximum of released memory in single GGC run: 32441k
    Garbage: 382398k -> 382404k
    Leak: 11678k
    Overhead: 47295k -> 47296k
    GGC runs: 323

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 119108k
    Peak memory use before GGC: 95788k
    Peak memory use after GGC: 94840k
    Maximum of released memory in single GGC run: 20762k
    Garbage: 224400k
    Leak: 49424k
    Overhead: 36945k
    GGC runs: 339

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 104960k -> 105016k
    Peak memory use before GGC: 94848k
    Peak memory use after GGC: 93906k
    Maximum of released memory in single GGC run: 19825k
    Garbage: 595837k -> 596383k
    Leak: 55375k -> 55359k
    Overhead: 64261k -> 64299k
    GGC runs: 519 -> 518

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 105152k
    Peak memory use before GGC: 94848k
    Peak memory use after GGC: 93906k
    Maximum of released memory in single GGC run: 19825k
    Garbage: 677845k -> 678390k
    Leak: 56310k -> 56310k
    Overhead: 75317k -> 75356k
    GGC runs: 588

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Amount of produced GGC garbage increased from 719773k to 720846k, overall 0.15%
    Overall memory needed: 106712k -> 106708k
    Peak memory use before GGC: 95930k
    Peak memory use after GGC: 94979k
    Maximum of released memory in single GGC run: 19927k
    Garbage: 719773k -> 720846k
    Leak: 56806k -> 56820k
    Overhead: 78460k -> 78536k
    GGC runs: 600 -> 603

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2005-07-11 19:27:23.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2005-07-12 05:54:33.000000000 +0000
@@ -1,3 +1,37 @@
+2005-07-11  Richard Henderson  <rth@redhat.com>
+
+	* config/alpha/alpha.c (alpha_gimplify_va_arg_1): Use
+	build_va_arg_indirect_ref.
+	(alpha_gimplify_va_arg): Likewise.
+	* config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise.
+	* config/i860/i860.c (i860_gimplify_va_arg_expr): Likewise.
+	* config/mips/mips.c (mips_gimplify_va_arg_expr): Likewise.
+	* config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise.
+	* config/sh/sh.c (sh_gimplify_va_arg_expr): Likewise.
+	* config/stormy16/stormy16.c (xstormy16_expand_builtin_va_arg):
+	Likewise.
+	* config/xtensa/xtensa.c (xtensa_gimplify_va_arg_expr): Likewise.
+
+2005-07-12  Zdenek Dvorak  <dvorakz@suse.cz>
+
+	* tree-flow.h (remove_empty_loops, single_dom_exit): Declare.
+	* passes.c (init_optimization_passes): Add pass_empty_loop.
+	* tree-pass.h (pass_empty_loop): Declare.
+	* tree-ssa-loop-ivcanon.c (empty_loop_p, remove_empty_loop,
+	try_remove_empty_loop, remove_empty_loops): New functions.
+	* tree-ssa-loop-ivopts.c (single_dom_exit): Export.
+	* tree-ssa-loop.c (tree_ssa_empty_loop, pass_empty_loop): New.
+
+2005-07-12  Peter Barada  <peter@the-baradas.com>
+
+	PR middle-end/16719
+	PR middle-end/18421
+	* config/m68k/m68k.h (HARD_REGNO_MODE_OK): Disallow bytes
+	in address registers.
+	* config/m68k/m68k.c (hard_regno_mode_ok): Likewise.
+	* config/m68k/m68k.md: Replace 's' with 'i' in 4th
+	alternative of addsi3_5200.
+
 2005-07-11  Ian Lance Taylor  <ian@airs.com>
 
 	* config/mips/mips.md (ffs<mode>2): Remove.


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