This is the mail archive of the gcc-regression@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

A recent patch increased GCC's memory consumption!


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: 24804k -> 24808k
    Peak memory use before GGC: 9672k -> 9675k
    Peak memory use after GGC: 9019k -> 9022k
    Maximum of released memory in single GGC run: 2793k
    Garbage: 42027k -> 42019k
    Leak: 6680k -> 6684k
    Overhead: 5768k -> 5769k
    GGC runs: 337 -> 338

comparing combine.c compilation at -O1 level:
    Overall memory needed: 16792k -> 16768k
    Peak memory use before GGC: 9129k -> 9132k
    Peak memory use after GGC: 8611k -> 8614k
    Maximum of released memory in single GGC run: 2139k
    Garbage: 64115k -> 64119k
    Leak: 7139k -> 7143k
    Overhead: 7993k -> 7992k
    GGC runs: 530 -> 529

comparing combine.c compilation at -O2 level:
    Overall memory needed: 24204k -> 24212k
    Peak memory use before GGC: 17657k -> 17660k
    Peak memory use after GGC: 17478k -> 17481k
    Maximum of released memory in single GGC run: 2512k
    Garbage: 86711k -> 86718k
    Leak: 7164k -> 7168k
    Overhead: 11007k -> 11007k
    GGC runs: 494 -> 493

comparing combine.c compilation at -O3 level:
  Amount of memory still referenced at the end of compilation increased from 7260k to 7280k, overall 0.27%
    Overall memory needed: 24708k -> 24680k
    Peak memory use before GGC: 17670k -> 17673k
    Peak memory use after GGC: 17478k -> 17481k
    Maximum of released memory in single GGC run: 3311k
    Garbage: 115790k -> 115793k
    Leak: 7260k -> 7280k
    Overhead: 14763k -> 14764k
    GGC runs: 541 -> 540

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 82968k -> 82972k
    Peak memory use before GGC: 70954k -> 70957k
    Peak memory use after GGC: 45261k -> 45264k
    Maximum of released memory in single GGC run: 37012k
    Garbage: 149563k -> 149562k
    Leak: 11537k -> 11540k
    Overhead: 18394k -> 18395k
    GGC runs: 270 -> 269

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 98576k -> 98580k
    Peak memory use before GGC: 72976k -> 72979k
    Peak memory use after GGC: 62383k -> 62386k
    Maximum of released memory in single GGC run: 36549k
    Garbage: 293938k -> 293937k
    Leak: 11636k -> 11640k
    Overhead: 35882k -> 35882k
    GGC runs: 385 -> 384

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 155108k -> 155128k
    Peak memory use before GGC: 116921k -> 116924k
    Peak memory use after GGC: 87330k -> 87333k
    Maximum of released memory in single GGC run: 33167k
    Garbage: 389348k -> 389348k
    Leak: 11496k -> 11500k
    Overhead: 47837k -> 47838k
    GGC runs: 309

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 155108k -> 155096k
    Peak memory use before GGC: 116923k -> 116926k
    Peak memory use after GGC: 87332k -> 87335k
    Maximum of released memory in single GGC run: 33167k
    Garbage: 390148k -> 390151k
    Leak: 11518k -> 11522k
    Overhead: 47961k -> 47962k
    GGC runs: 313

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

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 119228k -> 119232k
    Peak memory use before GGC: 110046k -> 110049k
    Peak memory use after GGC: 98627k -> 98630k
    Maximum of released memory in single GGC run: 19969k
    Garbage: 653999k -> 653957k
    Leak: 58418k -> 58453k
    Overhead: 89196k -> 89197k
    GGC runs: 509 -> 510

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 119228k -> 119232k
    Peak memory use before GGC: 110047k -> 110050k
    Peak memory use after GGC: 98627k -> 98630k
    Maximum of released memory in single GGC run: 19969k
    Garbage: 748324k -> 748281k
    Leak: 59333k -> 59368k
    Overhead: 106835k -> 106836k
    GGC runs: 591

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 121852k -> 121856k
    Peak memory use before GGC: 112790k -> 112793k
    Peak memory use after GGC: 100132k -> 100135k
    Maximum of released memory in single GGC run: 21327k
    Garbage: 807049k -> 807074k
    Leak: 60520k -> 60523k
    Overhead: 114487k -> 114486k
    GGC runs: 594

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2005-06-21 04:31:40.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2005-06-21 15:08:54.000000000 +0000
@@ -1,3 +1,40 @@
+2005-06-21  Dorit Nuzman  <dorit@il.ibm.com>
+
+	* genopinit.c (vec_shl_optab, vec_shr_optab): Initialize new optabs.
+	(reduc_plus_optab): Removed.  Replcaed with...
+	(reduc_splus_optab, reduc_uplus_optab): Initialize new optabs.
+	* optabs.c (optab_for_tree_code): Return reduc_splus_optab or
+	reduc_uplus_optab instead of reduc_plus_optab.
+	(expand_vec_shift_expr): New function.
+	(init_optabs): Initialize new optabs. Remove initialization of
+	reduc_plus_optab.
+	(optab_for_tree_code): Return vec_shl_optab/vec_shr_optab
+	for VEC_LSHIFT_EXPR/VEC_RSHIFT_EXPR.
+	* optabs.h (OTI_reduc_plus): Removed. Replaced with...
+	(OTI_reduc_splus, OTI_reduc_uplus): New.
+	(reduc_plus_optab): Removed.  Replcaed with...
+	(reduc_splus_optab, reduc_uplus_optab): New optabs.
+	(vec_shl_optab, vec_shr_optab): New optabs.
+	(expand_vec_shift_expr): New function declaration.
+
+	* tree.def (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR): New tree-codes.
+	* tree-inline.c (estimate_num_insns_1): Handle new tree-codes.
+	* expr.c (expand_expr_real_1): Handle new tree-codes.
+	* tree-pretty-print.c (dump_generic_node, op_symbol, op_prio): Likewise.
+	* tree-vect-generic.c (expand_vector_operations_1): Add assert.
+
+	* tree-vect-transform.c (vect_create_epilog_for_reduction): Add two
+	alternatives for generating reduction epilog code.
+	(vectorizable_reduction): Don't fail of direct reduction support is
+	not available.
+	(vectorizable_target_reduction_pattern): Likewise.
+
+	* config/rs6000/altivec.md (reduc_smax_v4si, reduc_smax_v4sf,
+	reduc_umax_v4si, reduc_smin_v4si, reduc_smin_v4sf, reduc_umin_v4si,
+	reduc_plus_v4si, reduc_plus_v4sf): Removed.
+	(vec_shl_<mode>, vec_shr_<mode>, altivec_vsumsws_nomode,
+	reduc_splus_<mode>, reduc_uplus_v16qi): New.
+
 2005-06-20  Daniel Berlin  <dberlin@dberlin.org>
 
 	* c-typeck.c (build_function_call): Set fundecl = function again.


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]