GCC memory consumption increased by recent patch!

gcctest@suse.de gcctest@suse.de
Sun Dec 19 06:26:00 GMT 2004


Hi,
Comparing memory consumption on compilation of combine.i and generate-3.4.ii I got:


comparing combine.c compilation at -O0 level:
  Amount of memory still referenced at the end of compilation increased from 6088k to 6118k, overall 0.49%
    Overall memory needed: 24577k -> 24585k
    Peak memory use before GGC: 9310k
    Peak memory use after GGC: 8624k
    Maximum of released memory in single GGC run: 2912k
    Garbage: 42433k -> 42442k
    Leak: 6088k -> 6118k
    Overhead: 5717k -> 5748k
    GGC runs: 353

comparing combine.c compilation at -O1 level:
  Amount of memory still referenced at the end of compilation increased from 6484k to 6514k, overall 0.46%
    Overall memory needed: 25505k -> 25509k
    Peak memory use before GGC: 9198k
    Peak memory use after GGC: 8720k
    Maximum of released memory in single GGC run: 2060k
    Garbage: 68005k -> 68022k
    Leak: 6484k -> 6514k
    Overhead: 10666k -> 10698k
    GGC runs: 545

comparing combine.c compilation at -O2 level:
  Amount of memory still referenced at the end of compilation increased from 6301k to 6331k, overall 0.47%
    Overall memory needed: 29089k -> 29093k
    Peak memory use before GGC: 12705k
    Peak memory use after GGC: 12578k
    Maximum of released memory in single GGC run: 2574k
    Garbage: 82223k -> 82229k
    Leak: 6301k -> 6331k
    Overhead: 14821k -> 14853k
    GGC runs: 547

comparing combine.c compilation at -O3 level:
  Overall memory allocated via mmap and sbrk increased from 31545k to 31593k, overall 0.15%
  Amount of memory still referenced at the end of compilation increased from 6832k to 6862k, overall 0.44%
    Overall memory needed: 31545k -> 31593k
    Peak memory use before GGC: 12987k
    Peak memory use after GGC: 12578k
    Maximum of released memory in single GGC run: 3407k
    Garbage: 111155k -> 111160k
    Leak: 6832k -> 6862k
    Overhead: 19903k -> 19934k
    GGC runs: 614

comparing insn-attrtab.c compilation at -O0 level:
  Amount of memory still referenced at the end of compilation increased from 10609k to 10634k, overall 0.24%
    Overall memory needed: 118468k
    Peak memory use before GGC: 79386k
    Peak memory use after GGC: 46137k
    Maximum of released memory in single GGC run: 43335k
    Garbage: 161980k -> 161981k
    Leak: 10609k -> 10634k
    Overhead: 21242k -> 21268k
    GGC runs: 296

comparing insn-attrtab.c compilation at -O1 level:
  Amount of memory still referenced at the end of compilation increased from 10955k to 10980k, overall 0.23%
    Overall memory needed: 129432k -> 129436k
    Peak memory use before GGC: 83952k
    Peak memory use after GGC: 70040k
    Maximum of released memory in single GGC run: 41104k
    Garbage: 445754k -> 445758k
    Leak: 10955k -> 10980k
    Overhead: 79294k -> 79321k
    GGC runs: 430

comparing insn-attrtab.c compilation at -O2 level:
  Amount of memory still referenced at the end of compilation increased from 10875k to 10901k, overall 0.23%
    Overall memory needed: 153912k
    Peak memory use before GGC: 99964k
    Peak memory use after GGC: 85453k
    Maximum of released memory in single GGC run: 42091k
    Garbage: 492644k -> 492647k
    Leak: 10875k -> 10901k
    Overhead: 87569k -> 87595k
    GGC runs: 364

comparing insn-attrtab.c compilation at -O3 level:
  Amount of memory still referenced at the end of compilation increased from 10918k to 10943k, overall 0.23%
    Overall memory needed: 153920k
    Peak memory use before GGC: 99966k
    Peak memory use after GGC: 85455k
    Maximum of released memory in single GGC run: 42091k
    Garbage: 493908k -> 493912k
    Leak: 10918k -> 10943k
    Overhead: 87733k -> 87759k
    GGC runs: 372

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 113404k -> 113408k
    Peak memory use before GGC: 89921k
    Peak memory use after GGC: 89026k
    Maximum of released memory in single GGC run: 19894k
    Garbage: 248747k -> 248876k
    Leak: 57792k
    Overhead: 45383k -> 45384k
    GGC runs: 362

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 95920k
    Peak memory use before GGC: 88916k -> 88922k
    Peak memory use after GGC: 87943k -> 87937k
    Maximum of released memory in single GGC run: 19401k -> 19407k
    Garbage: 552438k -> 552550k
    Leak: 59823k -> 59815k
    Overhead: 115281k -> 115274k
    GGC runs: 611

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 95920k
    Peak memory use before GGC: 88916k -> 88923k
    Peak memory use after GGC: 87944k -> 87937k
    Maximum of released memory in single GGC run: 19401k -> 19408k
    Garbage: 601684k -> 601759k
    Leak: 60405k -> 60405k
    Overhead: 137310k -> 137303k
    GGC runs: 652

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Overall memory allocated via mmap and sbrk increased from 98284k to 98508k, overall 0.23%
    Overall memory needed: 98284k -> 98508k
    Peak memory use before GGC: 90313k -> 90319k
    Peak memory use after GGC: 88776k -> 88770k
    Maximum of released memory in single GGC run: 20091k -> 20097k
    Garbage: 641542k -> 641698k
    Leak: 60744k -> 60760k
    Overhead: 148683k -> 148690k
    GGC runs: 645 -> 647

Head of changelog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2004-12-19 04:03:17.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2004-12-19 05:19:52.000000000 +0000
@@ -1,5 +1,32 @@
 2004-12-18  Richard Henderson  <rth@redhat.com>
 
+	PR middle-end/16417
+	* c-decl.c (store_parm_decls): Clarify get_pending_sizes insertion
+	comment.
+	* c-objc-common.c (c_cannot_inline_tree_fn): Remove pending sizes
+	checks.
+	* c-tree.h (struct lang_decl): Remove pending_sizes.
+	* function.c: Include tree-gimple.h
+	(assign_parm_setup_reg): Remove callee-copies code.
+	(gimplify_parm_type, gimplify_parameters): New functions.
+	(expand_pending_sizes): Remove.
+	(expand_function_start): Don't call it.
+	* gimplify.c (gimplify_expr): Examine DECL_VALUE_EXPR for PARM_DECL.
+	(gimplify_body): Add do_parms argument.  Use gimplify_parameters.
+	(gimplify_function_tree): Setup cfun.  Update gimplify_body call.
+	* tree-gimple.h (gimplify_body): Update decl.
+	* tree-inline.c (initialize_inlined_parameters): Update gimplify_body
+	call.
+	* tree.h (gimplify_parameters): Declare.
+	* Makefile.in (function.o): Depend on TREE_GIMPLE_H.
+
+2004-12-18  Richard Henderson  <rth@redhat.com>
+
+	* c-decl.c (finish_struct): Add DECL_EXPR for variable sized
+	structures seen inside functions.
+
+2004-12-18  Richard Henderson  <rth@redhat.com>
+
 	* c-decl.c (grokdeclarator): Save variable array size before
 	subtracting 1, rather than after.
 

I am friendly script caring about memory consumption in GCC.  Please contact
jh@suse.cz if something is going wrong.

The results can be reproduced by building 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.

Yours testing script.



More information about the Gcc-regression mailing list