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: 18227k -> 18243k
    Peak memory use before GGC: 2229k
    Peak memory use after GGC: 1936k
    Maximum of released memory in single GGC run: 293k
    Garbage: 421k -> 422k
    Leak: 2266k -> 2266k
    Overhead: 445k -> 445k
    GGC runs: 3

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

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

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

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

comparing combine.c compilation at -O0 level:
    Overall memory needed: 28411k -> 28427k
    Peak memory use before GGC: 9304k -> 9305k
    Peak memory use after GGC: 8843k -> 8844k
    Maximum of released memory in single GGC run: 2666k -> 2665k
    Garbage: 36845k -> 36852k
    Leak: 6454k -> 6457k
    Overhead: 4862k -> 4869k
    GGC runs: 280

comparing combine.c compilation at -O0 -g level:
  Peak amount of GGC memory allocated before garbage collecting increased from 10834k to 10855k, overall 0.19%
  Peak amount of GGC memory still allocated after garbage collectin increased from 10464k to 10485k, overall 0.20%
  Amount of memory still referenced at the end of compilation increased from 9214k to 9267k, overall 0.57%
    Overall memory needed: 30507k -> 30519k
    Peak memory use before GGC: 10834k -> 10855k
    Peak memory use after GGC: 10464k -> 10485k
    Maximum of released memory in single GGC run: 2420k -> 2415k
    Garbage: 37410k -> 37429k
    Leak: 9214k -> 9267k
    Overhead: 5497k -> 5537k
    GGC runs: 271

comparing combine.c compilation at -O1 level:
    Overall memory needed: 40251k -> 40267k
    Peak memory use before GGC: 17292k -> 17295k
    Peak memory use after GGC: 17117k -> 17120k
    Maximum of released memory in single GGC run: 2332k -> 2275k
    Garbage: 57470k -> 57482k
    Leak: 6508k -> 6510k
    Overhead: 6220k -> 6227k
    GGC runs: 356 -> 357

comparing combine.c compilation at -O2 level:
    Overall memory needed: 29802k
    Peak memory use before GGC: 17288k -> 17291k
    Peak memory use after GGC: 17117k -> 17120k
    Maximum of released memory in single GGC run: 2869k
    Garbage: 74938k -> 74952k
    Leak: 6614k -> 6616k
    Overhead: 8476k -> 8486k
    GGC runs: 413

comparing combine.c compilation at -O3 level:
    Overall memory needed: 28902k
    Peak memory use before GGC: 18417k -> 18419k
    Peak memory use after GGC: 17846k -> 17847k
    Maximum of released memory in single GGC run: 4106k
    Garbage: 112681k -> 112699k
    Leak: 6684k -> 6684k
    Overhead: 13027k -> 13039k
    GGC runs: 463

    Overall memory needed: 28411k -> 28427k
    Peak memory use before GGC: 9304k -> 9305k
    Peak memory use after GGC: 8843k -> 8844k
    Maximum of released memory in single GGC run: 2666k -> 2665k
    Garbage: 36845k -> 36852k
    Leak: 6454k -> 6457k
    Overhead: 4862k -> 4869k
    GGC runs: 280

comparing combine.c compilation at -O1 level:
    Overall memory needed: 40251k -> 40267k
    Peak memory use before GGC: 17292k -> 17295k
    Peak memory use after GGC: 17117k -> 17120k
    Maximum of released memory in single GGC run: 2332k -> 2275k
    Garbage: 57470k -> 57482k
    Leak: 6508k -> 6510k
    Overhead: 6220k -> 6227k
    GGC runs: 356 -> 357

comparing combine.c compilation at -O2 level:
    Overall memory needed: 29802k
    Peak memory use before GGC: 17288k -> 17291k
    Peak memory use after GGC: 17117k -> 17120k
    Maximum of released memory in single GGC run: 2869k
    Garbage: 74938k -> 74952k
    Leak: 6614k -> 6616k
    Overhead: 8476k -> 8486k
    GGC runs: 413

comparing combine.c compilation at -O3 level:
    Overall memory needed: 28902k
    Peak memory use before GGC: 18417k -> 18419k
    Peak memory use after GGC: 17846k -> 17847k
    Maximum of released memory in single GGC run: 4106k
    Garbage: 112681k -> 112699k
    Leak: 6684k -> 6684k
    Overhead: 13027k -> 13039k
    GGC runs: 463

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 88242k
    Peak memory use before GGC: 69788k -> 69789k
    Peak memory use after GGC: 44198k -> 44199k
    Maximum of released memory in single GGC run: 36963k -> 36964k
    Garbage: 129062k -> 129066k
    Leak: 9514k -> 9516k
    Overhead: 16996k -> 17001k
    GGC runs: 216

comparing insn-attrtab.c compilation at -O0 -g level:
  Amount of memory still referenced at the end of compilation increased from 10913k to 10947k, overall 0.31%
    Overall memory needed: 89422k
    Peak memory use before GGC: 70926k -> 70938k
    Peak memory use after GGC: 45442k -> 45455k
    Maximum of released memory in single GGC run: 36965k -> 36964k
    Garbage: 130490k -> 130495k
    Leak: 10913k -> 10947k
    Overhead: 17357k -> 17380k
    GGC runs: 212

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

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 119754k -> 119750k
    Peak memory use before GGC: 92604k
    Peak memory use after GGC: 84716k
    Maximum of released memory in single GGC run: 30394k -> 30395k
    Garbage: 317208k -> 317213k
    Leak: 9359k -> 9359k
    Overhead: 36365k -> 36376k
    GGC runs: 245

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

comparing Gerald's testcase PR8361 compilation at -O0 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 92691k to 92890k, overall 0.21%
  Peak amount of GGC memory still allocated after garbage collectin increased from 91771k to 91969k, overall 0.22%
  Amount of produced GGC garbage increased from 205599k to 205958k, overall 0.17%
  Amount of memory still referenced at the end of compilation increased from 47691k to 47742k, overall 0.11%
    Overall memory needed: 119550k -> 119582k
    Peak memory use before GGC: 92691k -> 92890k
    Peak memory use after GGC: 91771k -> 91969k
    Maximum of released memory in single GGC run: 19314k -> 19468k
    Garbage: 205599k -> 205958k
    Leak: 47691k -> 47742k
    Overhead: 20819k -> 21054k
    GGC runs: 401 -> 402

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
  Peak amount of GGC memory allocated before garbage collecting increased from 105108k to 105436k, overall 0.31%
  Peak amount of GGC memory still allocated after garbage collectin increased from 104059k to 104385k, overall 0.31%
  Amount of produced GGC garbage increased from 212182k to 212535k, overall 0.17%
  Amount of memory still referenced at the end of compilation increased from 70089k to 70700k, overall 0.87%
    Overall memory needed: 132454k -> 132478k
    Peak memory use before GGC: 105108k -> 105436k
    Peak memory use after GGC: 104059k -> 104385k
    Maximum of released memory in single GGC run: 19491k -> 19645k
    Garbage: 212182k -> 212535k
    Leak: 70089k -> 70700k
    Overhead: 26148k -> 26671k
    GGC runs: 377

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Amount of produced GGC garbage increased from 443668k to 444141k, overall 0.11%
  Amount of memory still referenced at the end of compilation increased from 50024k to 50075k, overall 0.10%
    Overall memory needed: 119302k -> 119338k
    Peak memory use before GGC: 97860k -> 97919k
    Peak memory use after GGC: 95650k -> 95707k
    Maximum of released memory in single GGC run: 18600k -> 18692k
    Garbage: 443668k -> 444141k
    Leak: 50024k -> 50075k
    Overhead: 32734k -> 32953k
    GGC runs: 551 -> 552

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Amount of memory still referenced at the end of compilation increased from 50707k to 50758k, overall 0.10%
    Overall memory needed: 119294k -> 119346k
    Peak memory use before GGC: 97860k -> 97920k
    Peak memory use after GGC: 95650k -> 95707k
    Maximum of released memory in single GGC run: 18600k -> 18691k
    Garbage: 501735k -> 502230k
    Leak: 50707k -> 50758k
    Overhead: 39818k -> 40063k
    GGC runs: 605 -> 606

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Amount of memory still referenced at the end of compilation increased from 50282k to 50333k, overall 0.10%
    Overall memory needed: 118926k -> 118938k
    Peak memory use before GGC: 97906k -> 97964k
    Peak memory use after GGC: 96936k -> 96993k
    Maximum of released memory in single GGC run: 18847k -> 18918k
    Garbage: 523878k -> 524391k
    Leak: 50282k -> 50333k
    Overhead: 40826k -> 41060k
    GGC runs: 620 -> 621

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: 147243k -> 147245k
    Leak: 7536k -> 7536k
    Overhead: 25302k -> 25304k
    GGC runs: 82

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
  Amount of memory still referenced at the end of compilation increased from 9184k to 9244k, overall 0.65%
    Overall memory needed: 138134k
    Peak memory use before GGC: 82530k -> 82542k
    Peak memory use after GGC: 59409k -> 59422k
    Maximum of released memory in single GGC run: 45558k
    Garbage: 147413k -> 147415k
    Leak: 9184k -> 9244k
    Overhead: 25737k -> 25769k
    GGC runs: 88

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

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 352058k -> 352150k
    Peak memory use before GGC: 206002k
    Peak memory use after GGC: 201778k
    Maximum of released memory in single GGC run: 108808k -> 108809k
    Garbage: 352211k -> 352435k
    Leak: 48184k -> 48185k
    Overhead: 47025k -> 47100k
    GGC runs: 110

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

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-11-15 11:48:46.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-11-16 04:22:31.000000000 +0000
@@ -1,3 +1,78 @@
+2006-11-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR middle-end/29862
+	* real.c (mpfr_from_real): Call mpfr_set_str before gcc_assert.
+
+2006-11-15  Paul Brook  <paul@codesourcery.com>
+
+	* config/arm/unwind-arm.c (_Unwind_GetDataRelBase,
+	_Unwind_GetTextRelBase): Move from here ...
+	* config/arm/pr-support.c (_Unwind_GetDataRelBase,
+	_Unwind_GetTextRelBase): ... To here.
+
+2006-11-15  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+	* tree-ssa-loop-ivopts.c (get_address_cost): Make sure memory
+	addresses we generate for testing are aligned.
+
+2006-11-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+	PR tree-opt/29788
+	* fold-const.c (fold_indirect_ref_1): Fold *&CONST_DECL down
+	to what is the const decl is a place holder for.
+
+2006-11-15  Uros Bizjak  <ubizjak@gmail.com>
+
+	* config/i386/i386.opt: New target option -mx87regparm.
+
+	* config/i386/i386.h (struct ix86_args): Add x87_nregs, x87_regno,
+	float_in_x87: Add new variables. mmx_words, sse_words: Remove.
+	(X87_REGPARM_MAX): Define.
+
+	* config/i386/i386.c (override_options): Error out for
+	-mx87regparm but no 80387 support.
+	(ix86_attribute_table): Add x87regparm.
+	(ix86_handle_cconv_attribute): Update comments for x87regparm.
+	(ix86_comp_type_attributes): Check for mismatched x87regparm types.
+	(ix86_function_x87regparm): New function.
+	(ix86_function_arg_regno_p): Add X87_REGPARM_MAX 80387 floating
+	point registers.
+	(init_cumulative_args): Initialize x87_nregs and float_in_x87
+	variables.
+	(function_arg_advance): Process x87_nregs and x87_regno when
+	floating point argument is to be passed in 80387 register.
+	(function_arg): Pass XFmode arguments in 80387 registers for local
+	functions.  Pass SFmode and DFmode arguments to local functions
+	in 80387 registers when flag_unsafe_math_optimizations is set.
+
+	* reg-stack.c (convert_regs_entry): Disable NaN load for
+	stack registers that are used for argument passing.
+
+	* doc/extend.texi: Document x87regparm function attribute.
+	* doc/invoke.texi: Document -mx87regparm.
+
+2006-11-15  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+	* tree-flow.h (multiplier_allowed_in_address_p): Adjust prototype.
+	* tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p): New
+	arg MODE; all callers changed.  Use it to determine validity per
+	machine mode instead of using Pmode for all memory references.
+	(get_address_cost): Likewise add and use new arg MEM_MODE.
+
+2006-11-15  Rask Ingemann Lambertsen <rask@sygehus.dk>
+	    J"orn Rennecke <joern.rennecke@st.com>
+
+	* combine.c (likely_spilled_retval_1): Fix masking operation.
+	(likely_spilled_retval_p): Use proper pattern for call to
+	likely_spilled_retval_1.
+
+2006-11-15  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+	* tree-ssa-loop-ivopts.c (determine_iv_costs): Fix formatting.
+
+	* config/bfin/bfin.c (legitimize_pic_address): Lose dead code
+	that tests for CONSTANT_POOL_ADDRESS_P.
+
 2006-11-15  Jakub Jelinek  <jakub@redhat.com>
 
 	PR tree-optimization/29581


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]