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: 8333k
    Peak memory use before GGC: 3397k
    Peak memory use after GGC: 3045k
    Maximum of released memory in single GGC run: 352k
    Garbage: 525k -> 525k
    Leak: 3800k -> 3800k
    Overhead: 915k -> 915k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 8349k
    Peak memory use before GGC: 3424k
    Peak memory use after GGC: 3072k
    Maximum of released memory in single GGC run: 352k
    Garbage: 527k -> 527k
    Leak: 3832k -> 3832k
    Overhead: 919k -> 919k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 8385k
    Peak memory use before GGC: 3397k
    Peak memory use after GGC: 3045k
    Maximum of released memory in single GGC run: 352k
    Garbage: 527k -> 527k
    Leak: 3800k -> 3800k
    Overhead: 915k -> 915k
    GGC runs: 3

comparing empty function compilation at -O2 level:
    Overall memory needed: 8393k
    Peak memory use before GGC: 3397k
    Peak memory use after GGC: 3045k
    Maximum of released memory in single GGC run: 352k
    Garbage: 531k -> 531k
    Leak: 3801k -> 3801k
    Overhead: 916k -> 916k
    GGC runs: 3

comparing empty function compilation at -O3 level:
    Overall memory needed: 8393k
    Peak memory use before GGC: 3397k
    Peak memory use after GGC: 3045k
    Maximum of released memory in single GGC run: 352k
    Garbage: 531k -> 531k
    Leak: 3801k -> 3801k
    Overhead: 916k -> 916k
    GGC runs: 3

comparing combine.c compilation at -O0 level:
    Overall memory needed: 23757k
    Peak memory use before GGC: 10324k -> 10322k
    Peak memory use after GGC: 9568k -> 9566k
    Maximum of released memory in single GGC run: 1902k -> 1903k
    Garbage: 39068k -> 39082k
    Leak: 8858k -> 8856k
    Overhead: 5786k -> 5782k
    GGC runs: 254

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 25621k
    Peak memory use before GGC: 11985k -> 11966k
    Peak memory use after GGC: 11359k -> 11331k
    Maximum of released memory in single GGC run: 1515k -> 1516k
    Garbage: 39449k -> 39436k
    Leak: 11742k -> 11682k
    Overhead: 6492k -> 6454k
    GGC runs: 249

comparing combine.c compilation at -O1 level:
    Overall memory needed: 35737k -> 35753k
    Peak memory use before GGC: 18985k -> 18983k
    Peak memory use after GGC: 18795k -> 18793k
    Maximum of released memory in single GGC run: 1375k -> 1379k
    Garbage: 52597k -> 52634k
    Leak: 8996k -> 8995k
    Overhead: 6751k -> 6748k
    GGC runs: 321

comparing combine.c compilation at -O2 level:
  Amount of produced GGC garbage increased from 71081k to 71173k, overall 0.13%
    Overall memory needed: 37761k
    Peak memory use before GGC: 19040k -> 19039k
    Peak memory use after GGC: 18851k -> 18848k
    Maximum of released memory in single GGC run: 1409k -> 1389k
    Garbage: 71081k -> 71173k
    Leak: 9324k -> 9319k
    Overhead: 8882k -> 8885k
    GGC runs: 383 -> 381

comparing combine.c compilation at -O3 level:
  Amount of produced GGC garbage increased from 92750k to 92851k, overall 0.11%
  Amount of memory still referenced at the end of compilation increased from 9436k to 9448k, overall 0.13%
    Overall memory needed: 40513k -> 40525k
    Peak memory use before GGC: 19314k -> 19312k
    Peak memory use after GGC: 18967k -> 18965k
    Maximum of released memory in single GGC run: 2262k
    Garbage: 92750k -> 92851k
    Leak: 9436k -> 9448k
    Overhead: 11506k -> 11516k
    GGC runs: 412 -> 413

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 140105k
    Peak memory use before GGC: 60581k -> 60580k
    Peak memory use after GGC: 34074k
    Maximum of released memory in single GGC run: 34144k -> 34143k
    Garbage: 132021k -> 132018k
    Leak: 11587k -> 11585k
    Overhead: 15589k -> 15587k
    GGC runs: 197

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 141357k
    Peak memory use before GGC: 61743k -> 61730k
    Peak memory use after GGC: 35235k -> 35223k
    Maximum of released memory in single GGC run: 34145k -> 34144k
    Garbage: 132249k -> 132243k
    Leak: 13295k -> 13261k
    Overhead: 15986k -> 15967k
    GGC runs: 200

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 150213k -> 150269k
    Peak memory use before GGC: 59098k -> 59097k
    Peak memory use after GGC: 52851k -> 52850k
    Maximum of released memory in single GGC run: 24232k
    Garbage: 212963k -> 212957k
    Leak: 12481k -> 12480k
    Overhead: 25582k -> 25595k
    GGC runs: 223

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 188917k -> 188773k
    Peak memory use before GGC: 59724k -> 59723k
    Peak memory use after GGC: 54430k -> 54429k
    Maximum of released memory in single GGC run: 22887k
    Garbage: 254075k -> 254069k
    Leak: 13563k -> 13562k
    Overhead: 31305k -> 31319k
    GGC runs: 250

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 195901k -> 195937k
    Peak memory use before GGC: 71708k
    Peak memory use after GGC: 65141k
    Maximum of released memory in single GGC run: 23329k -> 23330k
    Garbage: 281239k -> 281233k
    Leak: 13574k -> 13573k
    Overhead: 33104k -> 33117k
    GGC runs: 253

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 156943k -> 157023k
    Peak memory use before GGC: 91854k -> 91688k
    Peak memory use after GGC: 90944k -> 90780k
    Maximum of released memory in single GGC run: 18216k -> 18122k
    Garbage: 210833k -> 210576k
    Leak: 55682k -> 55630k
    Overhead: 27341k -> 27201k
    GGC runs: 394 -> 393

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 177439k -> 177743k
    Peak memory use before GGC: 104644k -> 104297k
    Peak memory use after GGC: 103604k -> 103253k
    Maximum of released memory in single GGC run: 18753k -> 18632k
    Garbage: 216705k -> 216439k
    Leak: 79111k -> 78499k
    Overhead: 33309k -> 32882k
    GGC runs: 373

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 133426k -> 133411k
    Peak memory use before GGC: 93626k -> 93582k
    Peak memory use after GGC: 92699k -> 92649k
    Maximum of released memory in single GGC run: 17368k -> 17300k
    Garbage: 318339k -> 318064k
    Leak: 55578k -> 55518k
    Overhead: 33125k -> 32923k
    GGC runs: 498 -> 499

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 94137k to 94305k, overall 0.18%
  Peak amount of GGC memory still allocated after garbage collecting increased from 93200k to 93358k, overall 0.17%
    Overall memory needed: 141766k -> 141711k
    Peak memory use before GGC: 94137k -> 94305k
    Peak memory use after GGC: 93200k -> 93358k
    Maximum of released memory in single GGC run: 17371k -> 17298k
    Garbage: 375331k -> 374993k
    Leak: 56810k -> 56758k
    Overhead: 39460k -> 39256k
    GGC runs: 558 -> 560

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 145330k -> 145335k
    Peak memory use before GGC: 95157k -> 95108k
    Peak memory use after GGC: 94074k -> 94026k
    Maximum of released memory in single GGC run: 17748k -> 17716k
    Garbage: 415700k -> 415393k
    Leak: 57207k -> 57155k
    Overhead: 42757k -> 42549k
    GGC runs: 585 -> 586

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 381015k -> 381012k
    Peak memory use before GGC: 103478k
    Peak memory use after GGC: 59131k
    Maximum of released memory in single GGC run: 50583k
    Garbage: 179674k -> 179673k
    Leak: 9011k -> 9011k
    Overhead: 31654k -> 31654k
    GGC runs: 65

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 381839k -> 381836k
    Peak memory use before GGC: 104124k -> 104111k
    Peak memory use after GGC: 59777k -> 59765k
    Maximum of released memory in single GGC run: 50583k -> 50582k
    Garbage: 179779k -> 179778k
    Leak: 10779k -> 10719k
    Overhead: 32150k -> 32119k
    GGC runs: 72

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 290085k
    Peak memory use before GGC: 82785k
    Peak memory use after GGC: 75173k
    Maximum of released memory in single GGC run: 40017k
    Garbage: 236071k -> 236069k
    Leak: 18350k -> 18350k
    Overhead: 32720k -> 32718k
    GGC runs: 69

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 277857k
    Peak memory use before GGC: 80160k -> 80159k
    Peak memory use after GGC: 75174k -> 75173k
    Maximum of released memory in single GGC run: 33750k
    Garbage: 246134k -> 246133k
    Leak: 18439k -> 18439k
    Overhead: 34945k -> 34943k
    GGC runs: 82

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
  Amount of produced GGC garbage increased from 356488k to 357941k, overall 0.41%
  Amount of memory still referenced at the end of compilation increased from 28513k to 28581k, overall 0.24%
    Overall memory needed: 1012597k -> 1019105k
    Peak memory use before GGC: 168801k
    Peak memory use after GGC: 158365k
    Maximum of released memory in single GGC run: 83496k -> 83495k
    Garbage: 356488k -> 357941k
    Leak: 28513k -> 28581k
    Overhead: 46900k -> 47049k
    GGC runs: 65

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-08-31 12:16:11.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-09-01 04:12:15.000000000 +0000
@@ -1,3 +1,76 @@
+2007-08-31  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+	* optabs.c (prepare_float_lib_cmp): Use
+	libgcc_cmp_return_mode instead of word_mode.
+	* config/dfp-bit.h: Likewise.
+	* config/fp-bit.h: Likewise.
+	* config/spu/spu.c (spu_libgcc_cmp_return_mode):
+	New function.
+	(spu_libgcc_shift_count_mode): New function.
+	(TARGET_LIBGCC_CMP_RETURN_MODE): Define.
+	(TARGET_LIBGCC_SHIFT_COUNT_MODE): Define.
+
+2007-08-31  Joseph Myers  <joseph@codesourcery.com>
+
+	* tree-pretty-print.c: Include output.h.
+	(dump_decl_name, dump_generic_node): Use %wd with pp_printf, not
+	HOST_WIDE_INT_PRINT_DEC.
+	* Makefile.in (tree-pretty-print.o): Add dependency on output.h.
+
+2007-08-31  Zdenek Dvorak  <ook@ucw.cz>
+
+	PR rtl-optimization/33224
+	* loop-iv.c (latch_dominating_def): Check that the definition belongs
+	to the analysed region.
+
+2007-08-31  Richard Guenther  <rguenther@suse.de>
+
+	* function.c (allocate_struct_function): Do not set
+	current_function_returns_pointer.
+	* function.h (struct var_refs_queue): Remove.
+	(struct simple_obstack_stack): Likewise.
+	(struct function): Remove fixup_var_refs_queue member.
+	Remove returns_pointer flag.
+	(current_function_returns_pointer): Remove define.
+
+2007-08-31  Nick Clifton  <nickc@redhat.com>
+
+	* tree-ssa-coalesce.c (compare_pairs): Use the elements as
+	secondary keys in order to obtain a stable sort.
+
+2007-08-31  Nick Clifton  <nickc@redhat.com>
+
+	PR target/33132
+	* config/m32r/constraints.md: Add W constraint for integer zero.
+	* config/m32r/m32r.md (get_pc): Use W and i constraints.
+	Fix length calculation by using alternatives.
+
+2007-08-31  Richard Sandiford  <richard@codesourcery.com>
+
+	* optabs.c (shift_optab_p, commutative_optab_p): New functions,
+	split out from expand_binop.
+	(avoid_expensive_constant): New function.
+	(expand_binop_directly): Remove commutative_op argument and
+	(expand_binop_directly): Remove commutative_op argument and
+	call cummutative_optab_p instead.  Do not change op0 or op1
+	when swapping xop0 and xop1.  Apply avoid_expensive_constant
+	to each argument after potential swapping.  Enforce the
+	canonical order of commutative operands.
+	(expand_binop): Use shift_optab_p and commutative_optab_p.
+	Update the calls to expand_binop_directly.  Only force constants
+	into registers when widening an operation.  Only swap operands
+	once a direct expansion has been rejected.
+	(expand_twoval_binop): Only force constants into registers when
+	using a direct expansion.
+
+2007-08-31  Maxim Kuvyrkov  <maxim@codesourcery.com>
+
+	* sched-deps.c (update_dep): Mark arguments with ATTRIBUTE_UNUSED.
+	(sched_analyze_insn): Don't postprocess speculative dependencies when
+	target has no scheduling.
+	* tree-vect-transform.c (vect_estimate_min_profitable_iters): Fix
+	'uninitialized' warning.
+
 2007-08-31  Richard Guenther  <rguenther@suse.de>
 
 	* tree.c (build_complex_type): Always set TYPE_NAME for
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2007-08-31 12:16:03.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2007-09-01 04:12:14.000000000 +0000
@@ -1,3 +1,24 @@
+2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
+
+	PR c++/32597
+	* init.c (build_default_init): Make extern.
+	* cp-tree.h (build_default_init): Declare here.
+	* pt.c (tsubst_expr): When the instantiation of the initializer of
+	a variable results in an empty list, default-initialize the
+	variable.
+	(tsubst_copy_and_build): When the instantiation of the initializer
+	in a new expression results in an empty initializer list,
+	default-initialize it.
+
+2007-08-31  Douglas Gregor  <doug.gregor@gmail.com>
+
+	* mangle.c (write_type): Change mangling of rvalue reference from
+	`RR' to `O'. 
+
+2007-08-31  Jakub Jelinek  <jakub@redhat.com>
+
+	* decl.c (duplicate_decls): Remove duplicated line.
+
 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
 
 	PR c++/33210
@@ -29,6 +50,7 @@
 	(get_delta_difference_1): New function.
 	(get_delta_difference): Refactor to call get_delta_difference_1.
 
+>>>>>>> .r127998
 2007-08-28  Paolo Carlini  <pcarlini@suse.de>
 
 	PR c++/33209


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]