This is the mail archive of the
gcc-regression@gcc.gnu.org
mailing list for the GCC project.
A recent patch increased GCC's memory consumption in some cases!
- From: gcctest at suse dot de
- To: jh at suse dot cz, gcc-regression at gcc dot gnu dot org
- Date: Tue, 19 Dec 2006 07:40:22 +0000
- Subject: 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: 18281k
Peak memory use before GGC: 2235k
Peak memory use after GGC: 1942k
Maximum of released memory in single GGC run: 293k
Garbage: 422k -> 423k
Leak: 2273k
Overhead: 446k -> 446k
GGC runs: 3
comparing empty function compilation at -O0 -g level:
Overall memory needed: 18297k
Peak memory use before GGC: 2263k
Peak memory use after GGC: 1970k
Maximum of released memory in single GGC run: 293k
Garbage: 425k -> 425k
Leak: 2305k
Overhead: 450k -> 450k
GGC runs: 3
comparing empty function compilation at -O1 level:
Overall memory needed: 18381k
Peak memory use before GGC: 2235k
Peak memory use after GGC: 1942k
Maximum of released memory in single GGC run: 293k
Garbage: 427k -> 427k
Leak: 2275k
Overhead: 446k -> 446k
GGC runs: 4
comparing empty function compilation at -O2 level:
Overall memory needed: 18393k
Peak memory use before GGC: 2236k
Peak memory use after GGC: 1942k
Maximum of released memory in single GGC run: 294k
Garbage: 430k -> 430k
Leak: 2275k
Overhead: 447k -> 447k
GGC runs: 4
comparing empty function compilation at -O3 level:
Overall memory needed: 18393k
Peak memory use before GGC: 2236k
Peak memory use after GGC: 1942k
Maximum of released memory in single GGC run: 294k
Garbage: 430k -> 430k
Leak: 2275k
Overhead: 447k -> 447k
GGC runs: 4
comparing combine.c compilation at -O0 level:
Overall memory needed: 28437k -> 28445k
Peak memory use before GGC: 9287k -> 9288k
Peak memory use after GGC: 8804k
Maximum of released memory in single GGC run: 2641k -> 2642k
Garbage: 37501k -> 37525k
Leak: 6454k
Overhead: 4867k -> 4872k
GGC runs: 280
comparing combine.c compilation at -O0 -g level:
Overall memory needed: 30525k
Peak memory use before GGC: 10834k -> 10835k
Peak memory use after GGC: 10464k
Maximum of released memory in single GGC run: 2360k -> 2320k
Garbage: 38076k -> 38104k
Leak: 9330k
Overhead: 5569k -> 5574k
GGC runs: 272
comparing combine.c compilation at -O1 level:
Overall memory needed: 29474k
Peak memory use before GGC: 16979k -> 16962k
Peak memory use after GGC: 16792k
Maximum of released memory in single GGC run: 2254k
Garbage: 55684k -> 55702k
Leak: 6489k -> 6481k
Overhead: 10560k -> 9959k
GGC runs: 360 -> 358
comparing combine.c compilation at -O2 level:
Amount of produced GGC garbage increased from 71697k to 71797k, overall 0.14%
Overall memory needed: 29474k
Peak memory use before GGC: 16988k -> 16967k
Peak memory use after GGC: 16792k
Maximum of released memory in single GGC run: 2611k -> 2363k
Garbage: 71697k -> 71797k
Leak: 6611k
Overhead: 12534k -> 11849k
GGC runs: 413 -> 412
comparing combine.c compilation at -O3 level:
Amount of produced GGC garbage increased from 106164k to 106280k, overall 0.11%
Overall memory needed: 29602k
Peak memory use before GGC: 18226k -> 18066k
Peak memory use after GGC: 17749k -> 17599k
Maximum of released memory in single GGC run: 4564k -> 3676k
Garbage: 106164k -> 106280k
Leak: 6688k -> 6684k
Overhead: 17995k -> 16905k
GGC runs: 463 -> 460
comparing insn-attrtab.c compilation at -O0 level:
Overall memory needed: 89650k -> 89654k
Peak memory use before GGC: 71193k
Peak memory use after GGC: 44699k -> 44700k
Maximum of released memory in single GGC run: 37868k
Garbage: 132105k -> 132119k
Leak: 9518k
Overhead: 16951k -> 16954k
GGC runs: 211
comparing insn-attrtab.c compilation at -O0 -g level:
Overall memory needed: 90826k
Peak memory use before GGC: 72354k -> 72355k
Peak memory use after GGC: 45967k
Maximum of released memory in single GGC run: 37868k -> 37869k
Garbage: 133511k -> 133525k
Leak: 10981k
Overhead: 17347k -> 17349k
GGC runs: 209
comparing insn-attrtab.c compilation at -O1 level:
Peak amount of GGC memory still allocated after garbage collecting decreased from 70764k to 67990k, overall -4.08%
Overall memory needed: 96054k -> 93726k
Peak memory use before GGC: 73119k -> 71858k
Peak memory use after GGC: 70764k -> 67990k
Maximum of released memory in single GGC run: 31671k
Garbage: 229860k -> 229875k
Leak: 9343k
Overhead: 31153k -> 29520k
GGC runs: 226 -> 220
comparing insn-attrtab.c compilation at -O2 level:
Ovarall memory allocated via mmap and sbrk decreased from 128386k to 123986k, overall -3.55%
Peak amount of GGC memory allocated before garbage collecting increased from 78731k to 79550k, overall 1.04%
Peak amount of GGC memory still allocated after garbage collecting decreased from 76200k to 73714k, overall -3.37%
Overall memory needed: 128386k -> 123986k
Peak memory use before GGC: 78731k -> 79550k
Peak memory use after GGC: 76200k -> 73714k
Maximum of released memory in single GGC run: 30216k
Garbage: 282673k -> 282685k
Leak: 9345k
Overhead: 37706k -> 35777k
GGC runs: 247 -> 243
comparing insn-attrtab.c compilation at -O3 level:
Ovarall memory allocated via mmap and sbrk decreased from 128162k to 123738k, overall -3.58%
Peak amount of GGC memory allocated before garbage collecting increased from 78756k to 79575k, overall 1.04%
Peak amount of GGC memory still allocated after garbage collecting decreased from 76226k to 73740k, overall -3.37%
Overall memory needed: 128162k -> 123738k
Peak memory use before GGC: 78756k -> 79575k
Peak memory use after GGC: 76226k -> 73740k
Maximum of released memory in single GGC run: 30410k
Garbage: 283517k -> 283525k
Leak: 9350k
Overhead: 37940k -> 36009k
GGC runs: 253 -> 247
comparing Gerald's testcase PR8361 compilation at -O0 level:
Amount of produced GGC garbage increased from 210968k to 211915k, overall 0.45%
Overall memory needed: 119066k
Peak memory use before GGC: 92331k -> 92332k
Peak memory use after GGC: 91417k
Maximum of released memory in single GGC run: 19252k -> 19250k
Garbage: 210968k -> 211915k
Leak: 48116k
Overhead: 21034k -> 21222k
GGC runs: 414 -> 416
comparing Gerald's testcase PR8361 compilation at -O0 -g level:
Amount of produced GGC garbage increased from 217553k to 218494k, overall 0.43%
Overall memory needed: 131642k
Peak memory use before GGC: 104696k -> 104689k
Peak memory use after GGC: 103652k
Maximum of released memory in single GGC run: 18947k -> 18932k
Garbage: 217553k -> 218494k
Leak: 71548k
Overhead: 26939k -> 27127k
GGC runs: 388 -> 389
comparing Gerald's testcase PR8361 compilation at -O1 level:
Overall memory needed: 119502k
Peak memory use before GGC: 96665k
Peak memory use after GGC: 94462k
Maximum of released memory in single GGC run: 17940k
Garbage: 442829k -> 442643k
Leak: 50182k -> 50182k
Overhead: 107697k -> 103830k
GGC runs: 566 -> 562
comparing Gerald's testcase PR8361 compilation at -O2 level:
Overall memory needed: 119554k
Peak memory use before GGC: 96692k
Peak memory use after GGC: 94489k
Maximum of released memory in single GGC run: 18081k
Garbage: 497832k -> 497476k
Leak: 51150k
Overhead: 63539k -> 58753k
GGC runs: 622 -> 615
comparing Gerald's testcase PR8361 compilation at -O3 level:
Overall memory needed: 121138k
Peak memory use before GGC: 97648k
Peak memory use after GGC: 96144k
Maximum of released memory in single GGC run: 18476k
Garbage: 518190k -> 517975k
Leak: 51123k
Overhead: 63458k -> 58758k
GGC runs: 625 -> 621
comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
Overall memory needed: 137646k -> 137642k
Peak memory use before GGC: 81587k -> 81588k
Peak memory use after GGC: 58467k
Maximum of released memory in single GGC run: 45167k
Garbage: 148513k -> 148519k
Leak: 7542k
Overhead: 25327k -> 25329k
GGC runs: 82
comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
Overall memory needed: 138014k
Peak memory use before GGC: 82233k -> 82234k
Peak memory use after GGC: 59113k
Maximum of released memory in single GGC run: 45232k
Garbage: 148723k -> 148730k
Leak: 9309k
Overhead: 25823k -> 25824k
GGC runs: 88
comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
Peak amount of GGC memory allocated before garbage collecting run decreased from 205843k to 199519k, overall -3.17%
Peak amount of GGC memory still allocated after garbage collecting decreased from 200073k to 192216k, overall -4.09%
Amount of produced GGC garbage increased from 283746k to 284119k, overall 0.13%
Overall memory needed: 423798k -> 418558k
Peak memory use before GGC: 205843k -> 199519k
Peak memory use after GGC: 200073k -> 192216k
Maximum of released memory in single GGC run: 99748k -> 94104k
Garbage: 283746k -> 284119k
Leak: 29778k
Overhead: 36143k -> 31548k
GGC runs: 97 -> 98
comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
Ovarall memory allocated via mmap and sbrk decreased from 355666k to 343378k, overall -3.58%
Peak amount of GGC memory allocated before garbage collecting run decreased from 205840k to 199512k, overall -3.17%
Peak amount of GGC memory still allocated after garbage collecting decreased from 200070k to 192209k, overall -4.09%
Overall memory needed: 355666k -> 343378k
Peak memory use before GGC: 205840k -> 199512k
Peak memory use after GGC: 200070k -> 192209k
Maximum of released memory in single GGC run: 96116k -> 96120k
Garbage: 364347k -> 364357k
Leak: 30361k
Overhead: 51892k -> 47297k
GGC runs: 105 -> 104
comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
Overall memory needed: 769754k -> 771818k
Peak memory use before GGC: 327243k -> 317621k
Peak memory use after GGC: 304885k -> 296096k
Maximum of released memory in single GGC run: 168283k
Garbage: 504429k -> 504436k
Leak: 45414k
Overhead: 66903k -> 60274k
GGC runs: 97 -> 98
Head of the ChangeLog is:
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog 2006-12-18 14:18:48.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog 2006-12-19 05:58:32.000000000 +0000
@@ -1,3 +1,73 @@
+2006-12-18 Roger Sayle <roger@eyesopen.com>
+ Eric Christopher <echristo@apple.com>
+
+ PR target/29302
+ * real.c (real_maxval): Correctly handle IBM extended double format.
+
+2006-12-19 Jan Hubicka <jh@suse.cz>
+
+ * expmed.c (expand_mult_const): Force operand to constant.
+ * rs6000.c (rs6000_emit_set_const, rs6000_emit_set_long_const): Add
+ copy_rtx to arguments.
+
+2006-12-19 Ben Elliston <bje@au.ibm.com>
+
+ * config/spu/spu.h (HANDLE_PRAGMA_PACK_PUSH_POP): Define.
+
+2006-12-19 Ben Elliston <bje@au.ibm.com>
+
+ * cse.c (cse_insn): Fix formatting.
+
+2006-12-18 Geoffrey Keating <geoffk@apple.com>
+
+ * doc/invoke.texi (Debugging Options): Document -g0.
+ * config/darwin.h (LINK_COMMAND_SPEC): Replace -gnone with -g0.
+ * config/darwin9.h (LINK_COMMAND_SPEC): Likewise.
+
+2006-12-18 Ian Lance Taylor <iant@google.com>
+
+ * c.opt (Wmissing-declarations): Add C++ and ObjC++.
+ * doc/invoke.texi (Warning Options): -Wmissing-declarations now
+ works for C++.
+
+2006-12-18 Andrew MacLeod <amacleod@redhat.com>
+
+ * tree-ssa-operands.h (struct vdef_optype_d): Rename to voptype_d.
+ (struct vuse_optype_d): Delete.
+ (SSA_OPERAND_MEMORY_SIZE): Delete.
+ (struct ssa_operand_memory_d): Change mem array to size one.
+ (NUM_VOP_FREE_BUCKETS): Define.
+ (free_vuses, free_vdefs): Replace with vop_free_buckets array.
+ (vdef_ops, vuse_ops, struct ssa_operand_iterator_d): Use voptype_d type.
+ * tree-pretty-print.c (dump_vops): Use voptype_d type.
+ * tree-ssa-operands.c (vop_free_bucket_size): New. Number of operands
+ which fit into a chunk of memory from a specific bucket.
+ (vop_free_bucket_index): New. Find correct size memory bucket.
+ (init_vop_buckets): New. Initialize VOP free memory buckets.
+ (add_vop_to_freelist): New. Add a VOP to the correct free list.
+ (ssa_operand_mem_size): New. Current size of an operand memory chunk.
+ (init_ssa_operands): Initialize operand memory and free lists.
+ (fini_ssa_operands): Remove references to free_vuses and free_vdefs.
+ (ssa_operand_alloc): Use graduated size memory allocation.
+ (APPEND_OP_AFTER, MOVE_HEAD_AFTER, MOVE_HEAD_TO_FREELIST,
+ INITIALIZE_USE): Remove.
+ (alloc_vop): New. Allocate a virtual operand.
+ (alloc_vdef, alloc_vuse): Delete.
+ (add_def_op, add_use_op): Directly setup pointers.
+ (add_vop): New. Add a virtual operand.
+ (add_vuse_op, add_vdef_op): Call add_vop.
+ (realloc_vop): New. Reallocate a virtual operand.
+ (realloc_vdef, realloc_vuse): Call realloc_vop.
+ (finalize_ssa_def_ops): Delete. Move content to finalize_ssa_defs.
+ (finalize_ssa_defs): Optimize for common case, remove code based on
+ sorted pointers which was a waste of time.
+ (finalize_ssa_use_ops): Delete. Move content to finalize_ssa_uses.
+ (finalize_ssa_uses): Update last pointer.
+ (finalize_ssa_vdef_ops): Delete. Move content to finalize_ssa_vdefs.
+ (finalize_ssa_vdefs, finalize_ssa_vuse_ops): Use voptype_d and
+ directly manipulate pointers.
+ (copy_virtual_operands): Use voptype_d, and no need to update pointers.
+
2006-12-18 Nathan Sidwell <nathan@codesourcery.com>
* config/rs6000/rs6000.md (*movdf_hardfloat32): Use %X format to
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp 2006-12-17 04:35:38.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog 2006-12-19 05:58:32.000000000 +0000
@@ -1,3 +1,8 @@
+2006-12-18 Ian Lance Taylor <iant@google.com>
+
+ * decl.c (start_preparsed_function): Add support for
+ -Wmissing-declarations.
+
2006-12-16 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.