GCC memory consumption decreased by recent patch

gcctest@suse.de gcctest@suse.de
Thu Oct 7 19:43: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:
    Overall memory needed: 25265k
    Peak memory use before GGC: 9345k
    Peak memory use after GGC: 8656k
    Maximum of released memory in single GGC run: 2939k
    Garbage: 43112k
    Leak: 6090k
    Overhead: 5691k
    GGC runs: 363

comparing combine.c compilation at -O1 level:
    Overall memory needed: 26713k
    Peak memory use before GGC: 9436k
    Peak memory use after GGC: 8872k
    Maximum of released memory in single GGC run: 2071k
    Garbage: 73084k
    Leak: 6677k
    Overhead: 11485k
    GGC runs: 576

comparing combine.c compilation at -O2 level:
    Overall memory needed: 29857k
    Peak memory use before GGC: 12772k
    Peak memory use after GGC: 12612k
    Maximum of released memory in single GGC run: 2596k
    Garbage: 88266k
    Leak: 6431k
    Overhead: 16029k
    GGC runs: 578

comparing combine.c compilation at -O3 level:
    Overall memory needed: 21480k
    Peak memory use before GGC: 13436k
    Peak memory use after GGC: 12722k
    Maximum of released memory in single GGC run: 3454k
    Garbage: 118669k
    Leak: 7000k
    Overhead: 21231k
    GGC runs: 643

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 118920k
    Peak memory use before GGC: 79664k
    Peak memory use after GGC: 46309k
    Maximum of released memory in single GGC run: 43569k
    Garbage: 163565k
    Leak: 10644k
    Overhead: 20606k
    GGC runs: 307

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 129756k
    Peak memory use before GGC: 90827k
    Peak memory use after GGC: 70898k
    Maximum of released memory in single GGC run: 42067k
    Garbage: 461322k
    Leak: 11075k
    Overhead: 74572k
    GGC runs: 460

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 209920k
    Peak memory use before GGC: 105788k
    Peak memory use after GGC: 86457k
    Maximum of released memory in single GGC run: 35975k
    Garbage: 510723k
    Leak: 10957k
    Overhead: 82616k
    GGC runs: 384

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 209916k
    Peak memory use before GGC: 105797k
    Peak memory use after GGC: 86466k
    Maximum of released memory in single GGC run: 35975k
    Garbage: 512100k
    Leak: 11011k
    Overhead: 82804k
    GGC runs: 393

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 113448k -> 112732k
    Peak memory use before GGC: 90536k -> 89930k
    Peak memory use after GGC: 89158k -> 88502k
    Maximum of released memory in single GGC run: 20157k -> 20159k
    Garbage: 262107k -> 256507k
    Leak: 59481k -> 58853k
    Overhead: 47299k -> 46997k
    GGC runs: 375 -> 367

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Ovarall memory allocated via mmap and sbrk decreased from 107932k to 102108k, overall -5.70%
  Peak amount of GGC memory allocated before garbage collecting run decreased from 95134k to 88748k, overall -7.20%
    Overall memory needed: 107932k -> 102108k
    Peak memory use before GGC: 95134k -> 88748k
    Peak memory use after GGC: 88446k -> 87590k
    Maximum of released memory in single GGC run: 19483k -> 19618k
    Garbage: 699635k -> 694013k
    Leak: 61537k -> 60909k
    Overhead: 132310k -> 132008k
    GGC runs: 626 -> 622

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Ovarall memory allocated via mmap and sbrk decreased from 108352k to 102464k, overall -5.75%
  Peak amount of GGC memory allocated before garbage collecting run decreased from 95135k to 88748k, overall -7.20%
    Overall memory needed: 108352k -> 102464k
    Peak memory use before GGC: 95135k -> 88748k
    Peak memory use after GGC: 88446k -> 87590k
    Maximum of released memory in single GGC run: 19484k -> 19617k
    Garbage: 750876k -> 745300k
    Leak: 62089k -> 61461k
    Overhead: 155124k -> 154821k
    GGC runs: 663 -> 659

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 113660k -> 113396k
    Peak memory use before GGC: 99940k -> 99323k
    Peak memory use after GGC: 89670k -> 89053k
    Maximum of released memory in single GGC run: 20199k -> 20029k
    Garbage: 848038k -> 842057k
    Leak: 62506k -> 61877k
    Overhead: 165241k -> 164917k
    GGC runs: 640 -> 633

Head of changelog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2004-10-07 13:50:51.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2004-10-07 18:30:08.000000000 +0000
@@ -1,3 +1,28 @@
+2004-10-07  Devang Patel  <dpatel@apple.com>
+
+        * rs6000/altivec.md (UNSPEC_VCMPBFP, UNSPEC_VCMPEQUB, UNSPEC_VCMPEQUH,
+        UNSPEC_VCMPEQUW, UNSPEC_VCMPGEFP, UNSPEC_VCMPGTUB, UNSPEC_VCMPGTSB,
+        UNSPEC_VCMPGTUH, UNSPEC_VCMPGTSH, UNSPEC_VCMPGTUW, UNSPEC_VCMPGTSW,
+        UNSPEC_VCMPGTFP, UNSPEC_VSEL4SI, UNSPEC_VSEL4SF, UNSPEC_VSEL8HI,
+        UNSPEC_VSEL16QI, UNSPEC_VCOND_V4SI, UNSPEC_VCOND_V4SF, UNSPEC_VCOND_V8HI,
+        UNSPEC_VCOND_V16QI, UNSPEC_VCONDU_V4SI, UNSPEC_VCONDU_V8HI, 
+	UNSPEC_VCONDU_V16QI): New constant defines.
+        (vcondv4si, vcondv4sf, vcondv8hi, vcondv16qi, vconduv4si, vconduv8hi,
+	vconduv16qi): New patterns.
+        * rs6000/rs6000-protos.h (rs6000_emit_vector_cond_expr): New function.
+        * rs6000/rs6000.c (rs6000_emit_vector_cond_expr): New function.
+        (get_vec_cmp_insn): Same.
+        (get_vsel_insn): Same.
+        (rs6000_emit_vector_compare): Same.
+        (rs6000_emit_vector_select): Same.
+	(INSN_NOT_AVAILABLE): New.
+	
+2004-10-07  Zdenek Dvorak  <dvorakz@suse.cz>
+
+	PR tree-optimization/17749
+	* tree-tailcall.c (find_tail_calls): Check that parameter is
+	a gimple_reg.
+
 2004-10-07  Kazu Hirata  <kazu@cs.umass.edu>
 
 	* config/ia64/ia64.c: Fix a comment typo.
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2004-10-07 13:50:57.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2004-10-07 18:30:10.000000000 +0000
@@ -1,3 +1,37 @@
+2004-10-07  Mark Mitchell  <mark@codesourcery.com>
+
+	* cp-tree.h (ICS_USER_FLAG): Remove comment about obsolete flag.
+	(DECL_MEMBER_TEMPLATE_P): New macro.
+	(is_member_template): Remove.
+	(class_method_index_for_fn): New function.
+	* pt.c (build_over_call): Use DECL_MEMBER_TEMPLATE_P.
+	* class.c (finish_struct_methods): Remove out-of-date comment.
+	* decl.c (copy_fn_p): Use DECL_MBMER_TEMPLATE_P.
+	* decl2.c (check_classfn): Use DECL_MEMBER_TEMPLATE_P and
+	class_method_index_for_fn.
+	* pt.c (is_member_template): Remove.
+	(is_member_template_class): Likewise.
+	(optimize_specialization_lookup_p): New function.
+	(retrieve_specialization): Optimize lookups for members that are
+	not member templates.
+	(register_specialization): Adjust accordingly.
+	(build_template_decl): Add member_template_p parameter.  Set
+	DECL_MEMBER_TEMPLATE_P.
+	(process_partial_specialization): Adjust call to
+	retrieve_specialization.
+	(push_template_decl_real): Determine whether the template is a
+	member template.
+	(lookup_template_class): Use retrieve_specialization.
+	(tsubst_decl): Adjust call to retrieve_specialization.
+	(tsubst_exception_specification): New function.
+	(tsubst): Use it.
+	(tsubst_copy): Use DECL_MEMBER_TEMPLATE_P.
+	(instantiate_template): Adjust call to retrieve_specialization.
+	(regenerate_decl_from_template): Do not actually generate a new
+	DECL.
+	(instantiate_decl): Adjust call to retrieve_specialization.
+	(class_method_index_for_fn): New method.
+
 2004-10-07  Andrew Pinski  <pinskia@physics.uc.edu>
 
 	* parser.c (cp_parser_asm_definition): Look passed the

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