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 in some cases!


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: 7383k
    Peak memory use before GGC: 2268k -> 2269k
    Peak memory use after GGC: 1957k -> 1958k
    Maximum of released memory in single GGC run: 311k
    Garbage: 446k
    Leak: 2291k -> 2292k
    Overhead: 456k -> 456k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 7399k
    Peak memory use before GGC: 2296k -> 2297k
    Peak memory use after GGC: 1985k -> 1986k
    Maximum of released memory in single GGC run: 311k
    Garbage: 449k
    Leak: 2324k -> 2325k
    Overhead: 461k -> 461k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 7511k
    Peak memory use before GGC: 2268k -> 2269k
    Peak memory use after GGC: 1957k -> 1958k
    Maximum of released memory in single GGC run: 311k
    Garbage: 452k
    Leak: 2294k -> 2295k
    Overhead: 457k -> 457k
    GGC runs: 4

comparing empty function compilation at -O2 level:
    Overall memory needed: 7519k
    Peak memory use before GGC: 2269k -> 2270k
    Peak memory use after GGC: 1958k -> 1959k
    Maximum of released memory in single GGC run: 311k
    Garbage: 455k
    Leak: 2294k -> 2295k
    Overhead: 457k -> 457k
    GGC runs: 4

comparing empty function compilation at -O3 level:
    Overall memory needed: 7519k
    Peak memory use before GGC: 2269k -> 2270k
    Peak memory use after GGC: 1958k -> 1959k
    Maximum of released memory in single GGC run: 311k
    Garbage: 455k
    Leak: 2294k -> 2295k
    Overhead: 457k -> 457k
    GGC runs: 4

comparing combine.c compilation at -O0 level:
    Overall memory needed: 17879k
    Peak memory use before GGC: 9276k -> 9277k
    Peak memory use after GGC: 8858k -> 8859k
    Maximum of released memory in single GGC run: 2584k
    Garbage: 37093k -> 37095k
    Leak: 6586k -> 6587k
    Overhead: 5036k -> 5036k
    GGC runs: 279

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 19895k
    Peak memory use before GGC: 10884k -> 10885k
    Peak memory use after GGC: 10518k -> 10519k
    Maximum of released memory in single GGC run: 2355k
    Garbage: 37681k -> 37703k
    Leak: 9462k -> 9464k
    Overhead: 5739k -> 5739k
    GGC runs: 269

comparing combine.c compilation at -O1 level:
    Overall memory needed: 35295k -> 35303k
    Peak memory use before GGC: 19349k -> 19350k
    Peak memory use after GGC: 19134k -> 19135k
    Maximum of released memory in single GGC run: 2169k
    Garbage: 57394k -> 57393k
    Leak: 6615k -> 6616k
    Overhead: 6370k -> 6370k
    GGC runs: 352

comparing combine.c compilation at -O2 level:
    Overall memory needed: 37591k -> 37583k
    Peak memory use before GGC: 19386k -> 19387k
    Peak memory use after GGC: 19184k -> 19185k
    Maximum of released memory in single GGC run: 2157k
    Garbage: 68661k -> 68659k
    Leak: 6732k -> 6725k
    Overhead: 7995k -> 7995k
    GGC runs: 403

comparing combine.c compilation at -O3 level:
    Overall memory needed: 47015k
    Peak memory use before GGC: 20423k -> 20424k
    Peak memory use after GGC: 19541k -> 19542k
    Maximum of released memory in single GGC run: 3135k
    Garbage: 100990k -> 101003k
    Leak: 6864k -> 6865k
    Overhead: 12221k -> 12221k
    GGC runs: 453

comparing insn-attrtab.c compilation at -O0 level:
  Amount of produced GGC garbage increased from 129954k to 130211k, overall 0.20%
    Overall memory needed: 103207k -> 103215k
    Peak memory use before GGC: 68881k -> 68882k
    Peak memory use after GGC: 44736k -> 44737k
    Maximum of released memory in single GGC run: 36678k
    Garbage: 129954k -> 130211k
    Leak: 9589k -> 9350k
    Overhead: 16801k -> 16801k
    GGC runs: 206

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 104607k -> 104619k
    Peak memory use before GGC: 70042k -> 70043k
    Peak memory use after GGC: 46004k -> 46005k
    Maximum of released memory in single GGC run: 36678k
    Garbage: 131109k -> 131109k
    Leak: 11278k -> 11279k
    Overhead: 17195k -> 17195k
    GGC runs: 206

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 147619k -> 147615k
    Peak memory use before GGC: 85870k -> 85871k
    Peak memory use after GGC: 80077k -> 80078k
    Maximum of released memory in single GGC run: 32817k
    Garbage: 264118k -> 264119k
    Leak: 9408k -> 9410k
    Overhead: 27484k -> 27484k
    GGC runs: 225

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 192611k -> 191851k
    Peak memory use before GGC: 87186k -> 87187k
    Peak memory use after GGC: 80147k -> 80148k
    Maximum of released memory in single GGC run: 31177k
    Garbage: 298878k -> 298877k
    Leak: 9405k -> 9407k
    Overhead: 33061k -> 33061k
    GGC runs: 245

comparing insn-attrtab.c compilation at -O3 level:
  Ovarall memory allocated via mmap and sbrk decreased from 200755k to 193187k, overall -3.92%
    Overall memory needed: 200755k -> 193187k
    Peak memory use before GGC: 87197k -> 87200k
    Peak memory use after GGC: 80158k -> 80161k
    Maximum of released memory in single GGC run: 31240k
    Garbage: 299538k -> 299536k
    Leak: 9411k -> 9412k
    Overhead: 33259k -> 33260k
    GGC runs: 245

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 148339k
    Peak memory use before GGC: 90645k -> 90646k
    Peak memory use after GGC: 89747k -> 89748k
    Maximum of released memory in single GGC run: 18005k
    Garbage: 208974k -> 208973k
    Leak: 49217k -> 49218k
    Overhead: 23460k -> 23460k
    GGC runs: 413

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 166703k -> 166655k
    Peak memory use before GGC: 103573k -> 103574k
    Peak memory use after GGC: 102547k -> 102548k
    Maximum of released memory in single GGC run: 18487k
    Garbage: 215569k -> 215570k
    Leak: 72642k -> 72643k
    Overhead: 29381k -> 29381k
    GGC runs: 385

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 142171k -> 142187k
    Peak memory use before GGC: 101987k -> 101989k
    Peak memory use after GGC: 100964k -> 100966k
    Maximum of released memory in single GGC run: 17236k
    Garbage: 345338k -> 345330k
    Leak: 49930k -> 49931k
    Overhead: 30011k -> 30011k
    GGC runs: 528

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 144303k -> 144315k
    Peak memory use before GGC: 102663k -> 102664k
    Peak memory use after GGC: 101610k -> 101611k
    Maximum of released memory in single GGC run: 17234k
    Garbage: 374131k -> 374162k
    Leak: 50533k -> 50534k
    Overhead: 33937k -> 33937k
    GGC runs: 562

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 146947k -> 146915k
    Peak memory use before GGC: 104417k -> 104418k
    Peak memory use after GGC: 103383k -> 103384k
    Maximum of released memory in single GGC run: 17650k
    Garbage: 391409k -> 391422k
    Leak: 51194k -> 51195k
    Overhead: 35268k -> 35271k
    GGC runs: 573

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 244755k
    Peak memory use before GGC: 80968k -> 80969k
    Peak memory use after GGC: 58707k -> 58708k
    Maximum of released memory in single GGC run: 44133k
    Garbage: 145362k
    Leak: 7618k -> 7619k
    Overhead: 24814k -> 24814k
    GGC runs: 79

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 245583k
    Peak memory use before GGC: 81614k -> 81615k
    Peak memory use after GGC: 59353k -> 59354k
    Maximum of released memory in single GGC run: 44123k
    Garbage: 145629k -> 145629k
    Leak: 9386k -> 9387k
    Overhead: 25310k -> 25310k
    GGC runs: 89

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 246091k -> 245975k
    Peak memory use before GGC: 85140k -> 85141k
    Peak memory use after GGC: 74852k -> 74853k
    Maximum of released memory in single GGC run: 36136k
    Garbage: 223655k
    Leak: 20861k -> 20863k
    Overhead: 30546k -> 30547k
    GGC runs: 81

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 499351k -> 499159k
    Peak memory use before GGC: 79839k -> 79840k
    Peak memory use after GGC: 74853k -> 74854k
    Maximum of released memory in single GGC run: 33434k
    Garbage: 230701k
    Leak: 20951k -> 20953k
    Overhead: 32630k -> 32630k
    GGC runs: 91

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 1188619k -> 1188675k
    Peak memory use before GGC: 201755k -> 201756k
    Peak memory use after GGC: 190217k -> 190218k
    Maximum of released memory in single GGC run: 80703k
    Garbage: 376734k
    Leak: 46317k -> 46318k
    Overhead: 49361k -> 49361k
    GGC runs: 70

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-02-20 01:10:10.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-02-20 17:17:42.000000000 +0000
@@ -1,3 +1,74 @@
+2007-02-20  Geoffrey Keating  <geoffk@apple.com>
+
+	* config/darwin.h (LINK_SPEC): Default -mmacosx-version-min only
+	if user didn't pass it.
+	* config/i386/darwin.h (CC1_SPEC): Likewise.
+	* config/rs6000/darwin.h (CC1_SPEC): Likewise.
+	(DARWIN_MINVERSION_SPEC): Don't depend on user's setting of
+	-mmacosx-version-min.
+
+2007-02-20  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+	    Uros Bizjak  <ubizjak@gmail.com>
+
+	* optabs.h (enum optab_index): Add new OTI_scalb.
+	(scalb_optab): Define corresponding macro.
+	* optabs.c (init_optabs): Initialize scalb_optab.
+	* genopinit.c (optabs): Implement scalb_optab using scalb?f3
+	patterns.
+	* builtins.c (expand_builtin_mathfn_2, expand_builtin): Handle
+	BUILT_IN_SCALB{,F,L}, BUILT_IN_SCALBN{,F,L} and BUILT_IN_SCALBLN{,F,L}.
+	(expand_builtin): Expand BUILT_IN_SCALB{,F,L}, BUILT_IN_SCALBN{,F,L}
+	and BUILT_IN_SCALBLN{,F,L} using expand_builtin_mathfn_2 if
+	flag_unsafe_math_optimizations is set.
+
+	* config/i386/i386.md (scalbxf3, scalb<mode>3): New expanders
+	to implement scalbf, scalb and scalbl built-ins as inline x87
+	intrinsics.
+
+2007-02-20  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
+            DJ Delorie <dj@redhat.com>
+
+	PR other/30824
+	* diagnostic.c (diagnostic_count_diagnostic): Move -Werror logic to...
+	(diagnostic_report_diagnostic): ... here, and turn them into real
+	errors. If warnings are inhibited, no need to do anything.
+
+2007-02-20  Uros Bizjak  <ubizjak@gmail.com>
+
+	* config/i386/i386.md (expm1xf2): Reorder insn sequence for
+	better code generation.
+
+2007-02-20  Ben Elliston  <bje@au.ibm.com>
+
+	* config/m68hc11/m68hc11.h (OVERRIDE_OPTIONS): Remove extra ;.
+
+2007-02-20  Kazu Hirata  <kazu@codesourcery.com>
+
+	* config/alpha/alpha.c, config/alpha/alpha.md,
+	config/alpha/lib1funcs.asm, config/alpha/vms-crt0-64.c,
+	config/alpha/vms-psxcrt0-64.c, config/arc/arc.c,
+	config/arc/arc.h, config/arm/arm.c, config/arm/arm.md,
+	config/arm/lib1funcs.asm: Follow spelling conventions.
+
+	* config/c4x/c4x.md, config/cris/cris.c, config/crx/crx.c,
+	config/fr30/fr30.md, config/i386/i386.h,
+	config/iq2000/iq2000.h, config/iq2000/predicates.md,
+	config/pa/milli64.S, config/pa/pa.c, config/pa/pa.h,
+	config/pa/pa.md, config/pa/pa32-regs.h, config/pa/pa64-regs.h,
+	config/pdp11/pdp11.c, config/pdp11/pdp11.h,
+	config/rs6000/altivec.md, config/rs6000/rs6000.c,
+	config/s390/s390-modes.def, config/sparc/netbsd-elf.h,
+	config/sparc/sparc.c, config/sparc/sparc.h,
+	config/sparc/sparc.md, config/spu/constraints.md,
+	config/spu/spu.c, config/stormy16/stormy16.md: Follow spelling
+	conventions.
+
+2007-02-20  Alan Modra  <amodra@bigpond.net.au>
+
+	PR target/29943
+	* varasm.c (use_blocks_for_decl_p): Return false for decls with
+	alias attribute.
+
 2007-02-19  Kazu Hirata  <kazu@codesourcery.com>
 
 	* doc/invoke.texi (-ftree-lrs): Remove.
@@ -43,9 +114,9 @@
 
 2007-02-19  Richard Henderson  <rth@redhat.com>
 
-        PR debug/29558
-        * var-tracking.c (track_expr_p): Disallow AGGREGATE_TYPE_P
-        in memory.
+	PR debug/29558
+	* var-tracking.c (track_expr_p): Disallow AGGREGATE_TYPE_P
+	in memory.
 
 2007-02-19  Andreas Krebbel  <krebbel1@de.ibm.com>
 
@@ -795,7 +866,7 @@
 
 	* except.c (expand_builtin_eh_return_data_regno): Pass entire
 	CALL_EXPR as parameter instead of arglist.  Use new CALL_EXPR
-        accessors.
+	accessors.
 
 	* coverage.c (create_coverage): Use build_call_expr.
 
@@ -2302,8 +2373,8 @@
 
 2007-02-03  Douglas Gregor  <doug.gregor@gmail.com>
 
-       * c-opts.c (c_common_post_options): If C++0x mode is enabled, don't
-       warn about C++0x compatibility.
+	* c-opts.c (c_common_post_options): If C++0x mode is enabled, don't
+	warn about C++0x compatibility.
 
 2007-02-04  Kazu Hirata  <kazu@codesourcery.com>
 
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2007-02-20 01:10:09.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2007-02-20 17:17:40.000000000 +0000
@@ -1,3 +1,8 @@
+2007-02-19  Mark Mitchell  <mark@codesourcery.com>
+
+	* call.c (build_new_method_call): Ensure that explicit calls of
+	destructors have type "void".
+
 2007-02-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
 
 	* typeck.c (build_binary_op): Replace -Wstring-literal-comparison


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]