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 empty function compilation at -O0 level:
    Overall memory needed: 18247k
    Peak memory use before GGC: 2229k
    Peak memory use after GGC: 1936k
    Maximum of released memory in single GGC run: 293k
    Garbage: 422k
    Leak: 2266k
    Overhead: 445k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 18263k
    Peak memory use before GGC: 2256k
    Peak memory use after GGC: 1963k
    Maximum of released memory in single GGC run: 293k
    Garbage: 424k
    Leak: 2298k
    Overhead: 449k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 18347k
    Peak memory use before GGC: 2229k
    Peak memory use after GGC: 1936k
    Maximum of released memory in single GGC run: 293k
    Garbage: 427k
    Leak: 2269k
    Overhead: 445k
    GGC runs: 4

comparing empty function compilation at -O2 level:
    Overall memory needed: 18359k
    Peak memory use before GGC: 2229k
    Peak memory use after GGC: 1936k
    Maximum of released memory in single GGC run: 293k
    Garbage: 430k
    Leak: 2269k
    Overhead: 446k
    GGC runs: 4

comparing empty function compilation at -O3 level:
    Overall memory needed: 18359k
    Peak memory use before GGC: 2229k
    Peak memory use after GGC: 1936k
    Maximum of released memory in single GGC run: 293k
    Garbage: 430k
    Leak: 2269k
    Overhead: 446k
    GGC runs: 4

comparing combine.c compilation at -O0 level:
    Overall memory needed: 28431k
    Peak memory use before GGC: 9305k
    Peak memory use after GGC: 8844k
    Maximum of released memory in single GGC run: 2665k
    Garbage: 36852k
    Leak: 6456k
    Overhead: 4868k
    GGC runs: 280

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 30523k
    Peak memory use before GGC: 10855k
    Peak memory use after GGC: 10485k
    Maximum of released memory in single GGC run: 2415k
    Garbage: 37429k
    Leak: 9266k
    Overhead: 5536k
    GGC runs: 271

comparing combine.c compilation at -O1 level:
    Overall memory needed: 40271k
    Peak memory use before GGC: 17295k
    Peak memory use after GGC: 17120k
    Maximum of released memory in single GGC run: 2275k
    Garbage: 57480k
    Leak: 6510k
    Overhead: 6226k
    GGC runs: 357

comparing combine.c compilation at -O2 level:
    Overall memory needed: 29802k
    Peak memory use before GGC: 17291k
    Peak memory use after GGC: 17120k
    Maximum of released memory in single GGC run: 2869k
    Garbage: 74950k
    Leak: 6616k
    Overhead: 8484k
    GGC runs: 413

comparing combine.c compilation at -O3 level:
    Overall memory needed: 28902k
    Peak memory use before GGC: 18419k
    Peak memory use after GGC: 17847k
    Maximum of released memory in single GGC run: 4106k
    Garbage: 112706k
    Leak: 6684k
    Overhead: 13037k
    GGC runs: 463

    Overall memory needed: 28431k
    Peak memory use before GGC: 9305k
    Peak memory use after GGC: 8844k
    Maximum of released memory in single GGC run: 2665k
    Garbage: 36852k
    Leak: 6456k
    Overhead: 4868k
    GGC runs: 280

comparing combine.c compilation at -O1 level:
    Overall memory needed: 40271k
    Peak memory use before GGC: 17295k
    Peak memory use after GGC: 17120k
    Maximum of released memory in single GGC run: 2275k
    Garbage: 57480k
    Leak: 6510k
    Overhead: 6226k
    GGC runs: 357

comparing combine.c compilation at -O2 level:
    Overall memory needed: 29802k
    Peak memory use before GGC: 17291k
    Peak memory use after GGC: 17120k
    Maximum of released memory in single GGC run: 2869k
    Garbage: 74950k
    Leak: 6616k
    Overhead: 8484k
    GGC runs: 413

comparing combine.c compilation at -O3 level:
    Overall memory needed: 28902k
    Peak memory use before GGC: 18419k
    Peak memory use after GGC: 17847k
    Maximum of released memory in single GGC run: 4106k
    Garbage: 112706k
    Leak: 6684k
    Overhead: 13037k
    GGC runs: 463

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 88242k
    Peak memory use before GGC: 69789k
    Peak memory use after GGC: 44199k
    Maximum of released memory in single GGC run: 36964k
    Garbage: 129066k
    Leak: 9515k
    Overhead: 17000k
    GGC runs: 216

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 89422k
    Peak memory use before GGC: 70938k
    Peak memory use after GGC: 45455k
    Maximum of released memory in single GGC run: 36964k
    Garbage: 130494k
    Leak: 10946k
    Overhead: 17379k
    GGC runs: 212

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 112878k -> 112882k
    Peak memory use before GGC: 90375k
    Peak memory use after GGC: 83737k
    Maximum of released memory in single GGC run: 31852k
    Garbage: 277775k
    Leak: 9357k
    Overhead: 29791k
    GGC runs: 222

comparing insn-attrtab.c compilation at -O2 level:
  Overall memory allocated via mmap and sbrk increased from 124570k to 129382k, overall 3.86%
    Overall memory needed: 124570k -> 129382k
    Peak memory use before GGC: 92604k
    Peak memory use after GGC: 84716k
    Maximum of released memory in single GGC run: 30395k
    Garbage: 317213k
    Leak: 9359k
    Overhead: 36375k
    GGC runs: 245

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 129418k
    Peak memory use before GGC: 92630k
    Peak memory use after GGC: 84742k
    Maximum of released memory in single GGC run: 30582k
    Garbage: 318075k
    Leak: 9362k
    Overhead: 36611k
    GGC runs: 249

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 119998k
    Peak memory use before GGC: 93308k
    Peak memory use after GGC: 92381k
    Maximum of released memory in single GGC run: 20013k
    Garbage: 207751k
    Leak: 47725k
    Overhead: 20983k
    GGC runs: 409

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 132498k
    Peak memory use before GGC: 105437k
    Peak memory use after GGC: 104386k
    Maximum of released memory in single GGC run: 19646k
    Garbage: 214333k
    Leak: 70684k
    Overhead: 26599k
    GGC runs: 380

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 119134k
    Peak memory use before GGC: 97919k
    Peak memory use after GGC: 95707k
    Maximum of released memory in single GGC run: 18553k
    Garbage: 446293k
    Leak: 50111k
    Overhead: 32835k
    GGC runs: 559

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 119158k
    Peak memory use before GGC: 97919k
    Peak memory use after GGC: 95706k
    Maximum of released memory in single GGC run: 18552k
    Garbage: 505321k
    Leak: 50795k
    Overhead: 40027k
    GGC runs: 613

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 118990k
    Peak memory use before GGC: 97964k
    Peak memory use after GGC: 96993k
    Maximum of released memory in single GGC run: 18932k
    Garbage: 526353k
    Leak: 50340k
    Overhead: 40933k
    GGC runs: 628

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 137786k -> 137958k
    Peak memory use before GGC: 81909k
    Peak memory use after GGC: 58788k
    Maximum of released memory in single GGC run: 45493k
    Garbage: 147244k
    Leak: 7536k
    Overhead: 25303k
    GGC runs: 82

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 138134k
    Peak memory use before GGC: 82542k
    Peak memory use after GGC: 59422k
    Maximum of released memory in single GGC run: 45558k
    Garbage: 147415k
    Leak: 9244k
    Overhead: 25769k
    GGC runs: 88

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 424330k
    Peak memory use before GGC: 205229k
    Peak memory use after GGC: 201005k
    Maximum of released memory in single GGC run: 101903k
    Garbage: 272136k
    Leak: 47601k
    Overhead: 31281k
    GGC runs: 101

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 352082k -> 352566k
    Peak memory use before GGC: 206002k
    Peak memory use after GGC: 201778k
    Maximum of released memory in single GGC run: 108808k
    Garbage: 352361k
    Leak: 48184k
    Overhead: 47026k
    GGC runs: 110

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 781310k
    Peak memory use before GGC: 314925k
    Peak memory use after GGC: 293268k
    Maximum of released memory in single GGC run: 165331k
    Garbage: 494545k
    Leak: 65517k
    Overhead: 59917k
    GGC runs: 98

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-11-20 21:25:19.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-11-21 13:57:32.000000000 +0000
@@ -1,3 +1,95 @@
+2006-11-21  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+	* config/bfin/bfin.opt (mstack-check-l1): New.
+	* doc/invoke.texi (Blackfin Options): Document it.
+	* config/bfin/bfin.c (bfin_expand_prologue): Generate code to use
+	stack bounds in L1 memory if the new option is enabled.
+	(override_options): Don't allow combinations of -fstack-limit and
+	-mstack-check-l1.
+	(add_to_reg): Renamed from add_to_sp.  All callers changed.  Lose some
+	dead code.
+
+	* config/bfin/bfin.c (hard_regno_mode_ok): Only allow first 31
+	regs for DImode.
+	(bfin_register_move_cost): Bump costs if trying to move plain
+	integer values through accumulators.
+
+2006-11-21  Ben Elliston  <bje@au.ibm.com>
+
+	* config/spu/spu.c (spu_expand_vector_init): Initialise x.
+
+2006-11-20  Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
+	    Russell Olsen <Russell_Olsen@playstation.sony.com>
+	    Dmitri Makarov <Dmitri_Makarov@playstation.sony.com>
+	    Yukishige Shibata <shibata@rd.scei.sony.co.jp>
+	    Nobuhisa Fujinami <fnami@rd.scei.sony.co.jp>
+	    Takeaki Fukuoka <fukuoka@rd.scei.sony.co.jp>
+	    Andrew Pinski <Andrew_Pinski@playstation.sony.com>
+
+	* config.gcc: Add target for SPU.
+	* config/spu/constraints.md: New file.
+	* config/spu/crt0.c: New file.
+	* config/spu/crtend.c: New file.
+	* config/spu/crti.asm: New file.
+	* config/spu/crtn.asm: New file.
+	* config/spu/float_unsdidf.c: New file.
+	* config/spu/float_unssidf.c: New file.
+	* config/spu/predicates.md: New file.
+	* config/spu/spu-builtins.def: New file.
+	* config/spu/spu-builtins.h: New file.
+	* config/spu/spu-builtins.md: New file.
+	* config/spu/spu-c.c: New file.
+	* config/spu/spu-elf.h: New file.
+	* config/spu/spu-modes.def: New file.
+	* config/spu/spu-protos.h: New file.
+	* config/spu/spu.c: New file.
+	* config/spu/spu.h: New file.
+	* config/spu/spu.md: New file.
+	* config/spu/spu.opt: New file.
+	* config/spu/spu_internals.h: New file.
+	* config/spu/spu_intrinsics.h: New file.
+	* config/spu/spu_mfcio.h: New file.
+	* config/spu/t-spu-elf: New file.
+	* config/spu/vec_types.h: New file.
+	* config/spu/vmx2spu.h: New file.
+	* doc/contrib.texi: Document SPU contributor.
+	* doc/extend.texi: Document SPU extensions.
+	* doc/invoke.texi: Document SPU options.
+	* doc/md.texi: Document SPU constraints.
+
+2006-11-21  Zdenek Dvorak <dvorakz@suse.cz>
+
+	* cfgloopmanip.c (add_loop, duplicate_loop): Do not set level
+	of the loop.
+	* cfgloop.c (flow_loop_level_compute, flow_loops_level_compute):
+	Removed.
+	(flow_loop_dump): Do not dump loop level.
+	(flow_loops_find): Do not call flow_loops_level_compute.
+	* cfgloop.h (struct loop): Remove level field.
+
+2006-11-21  Zdenek Dvorak <dvorakz@suse.cz>
+
+	* tree-ssa-loop-im.c (schedule_sm, determine_lsm_ref,
+	hoist_memory_references, loop_suitable_for_sm, determine_lsm_loop):
+	Use vector of edges instead of array.
+	* tree-ssa-loop-niter.c (find_loop_niter, find_loop_niter_by_eval,
+	estimate_numbers_of_iterations_loop): Ditto.
+	* predict.c (predict_loops): Ditto.
+	* loop-unroll.c (analyze_insns_in_loop): Ditto.
+	* tree-ssa-threadupdate.c: Remove declaration of heap allocation for
+	edge vectors.
+	* basic-block.h: Declare heap allocation for edge vectors.
+	* tree-outof-ssa.c: Ditto.
+	* cfgloop.c (get_loop_exit_edges): Return vector of edges.
+	* cfgloop.h (get_loop_exit_edges): Declaration changed.
+
+2006-11-20  Zack Weinberg  <zackw@panix.com>
+
+	* gengtype.c (process_gc_options): Remove unnecessary forward decl.
+	Add another out parameter, "skip".
+	(set_gc_used_type): Adjust calls to process_gc_options.  If a field
+	is tagged "skip", do not mark its type used.
+
 2006-11-20  Andrew Pinski  <andrew_pinski@playstation.sony.com>
 
 	PR tree-opt/25500
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2006-11-20 21:25:19.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2006-11-21 13:57:30.000000000 +0000
@@ -1,3 +1,16 @@
+2006-11-21  Jakub Jelinek  <jakub@redhat.com>
+
+	PR c++/29570
+	* decl.c (cp_finish_decl): Check for value dependent brace enclosed
+	scalar initializer.
+
+	PR c++/29734
+	* cp-tree.h (WANT_VECTOR): Define.
+	(WANT_ARITH): Add WANT_VECTOR.
+	* cvt.c (build_expr_type_conversion): Handle vector types.
+	* typeck.c (build_unary_op): Add WANT_VECTOR to
+	build_expr_type_conversion flags.
+
 2006-11-20  Simon Martin  <simartin@users.sourceforge.net>
 
 	PR c++/29475


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]