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!
- From: gcctest at suse dot de
- To: jh at suse dot cz, gcc-regression at gcc dot gnu dot org
- Date: Sun, 24 Dec 2006 14:34:43 +0000
- Subject: 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: 18305k
Peak memory use before GGC: 2235k
Peak memory use after GGC: 1942k
Maximum of released memory in single GGC run: 293k
Garbage: 423k -> 423k
Leak: 2273k
Overhead: 446k -> 446k
GGC runs: 3
comparing empty function compilation at -O0 -g level:
Overall memory needed: 18321k
Peak memory use before GGC: 2263k
Peak memory use after GGC: 1970k
Maximum of released memory in single GGC run: 293k
Garbage: 426k -> 425k
Leak: 2305k
Overhead: 450k -> 450k
GGC runs: 3
comparing empty function compilation at -O1 level:
Overall memory needed: 18405k -> 18409k
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: 18417k -> 18421k
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: 18417k -> 18421k
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:
Amount of memory still referenced at the end of compilation increased from 6454k to 6470k, overall 0.25%
Overall memory needed: 28473k
Peak memory use before GGC: 9288k -> 9255k
Peak memory use after GGC: 8803k
Maximum of released memory in single GGC run: 2642k -> 2609k
Garbage: 37567k -> 37143k
Leak: 6454k -> 6470k
Overhead: 4875k -> 4774k
GGC runs: 281 -> 280
comparing combine.c compilation at -O0 -g level:
Overall memory needed: 30549k
Peak memory use before GGC: 10834k
Peak memory use after GGC: 10463k
Maximum of released memory in single GGC run: 2320k -> 2365k
Garbage: 38128k -> 37748k
Leak: 9346k -> 9330k
Overhead: 5576k -> 5475k
GGC runs: 272 -> 270
comparing combine.c compilation at -O1 level:
Overall memory needed: 29474k
Peak memory use before GGC: 16963k
Peak memory use after GGC: 16792k
Maximum of released memory in single GGC run: 2251k -> 2219k
Garbage: 55778k -> 55490k
Leak: 6481k -> 6482k
Overhead: 9963k -> 9901k
GGC runs: 357 -> 362
comparing combine.c compilation at -O2 level:
Amount of memory still referenced at the end of compilation increased from 6604k to 6613k, overall 0.12%
Overall memory needed: 29474k
Peak memory use before GGC: 16967k
Peak memory use after GGC: 16792k
Maximum of released memory in single GGC run: 2374k -> 2299k
Garbage: 71989k -> 71662k
Leak: 6604k -> 6613k
Overhead: 11953k -> 11885k
GGC runs: 413
comparing combine.c compilation at -O3 level:
Overall memory needed: 29602k
Peak memory use before GGC: 18067k
Peak memory use after GGC: 17600k
Maximum of released memory in single GGC run: 3692k -> 3658k
Garbage: 106245k -> 105773k
Leak: 6684k
Overhead: 16872k -> 16762k
GGC runs: 460 -> 462
comparing insn-attrtab.c compilation at -O0 level:
Overall memory needed: 89650k -> 89138k
Peak memory use before GGC: 71193k -> 70681k
Peak memory use after GGC: 44699k
Maximum of released memory in single GGC run: 37868k -> 37356k
Garbage: 132141k -> 130715k
Leak: 9518k -> 9278k
Overhead: 16956k -> 16498k
GGC runs: 211 -> 207
comparing insn-attrtab.c compilation at -O0 -g level:
Amount of memory still referenced at the end of compilation increased from 10981k to 11221k, overall 2.19%
Overall memory needed: 90826k -> 90314k
Peak memory use before GGC: 72354k -> 71842k
Peak memory use after GGC: 45966k
Maximum of released memory in single GGC run: 37868k -> 37356k
Garbage: 133548k -> 131602k
Leak: 10981k -> 11221k
Overhead: 17351k -> 16893k
GGC runs: 209 -> 206
comparing insn-attrtab.c compilation at -O1 level:
Overall memory allocated via mmap and sbrk increased from 93726k to 96722k, overall 3.20%
Overall memory needed: 93726k -> 96722k
Peak memory use before GGC: 71858k
Peak memory use after GGC: 67990k
Maximum of released memory in single GGC run: 31668k -> 31412k
Garbage: 229914k -> 229162k
Leak: 9343k
Overhead: 29517k -> 29436k
GGC runs: 220
comparing insn-attrtab.c compilation at -O2 level:
Overall memory allocated via mmap and sbrk increased from 105394k to 109426k, overall 3.83%
Overall memory needed: 105394k -> 109426k
Peak memory use before GGC: 79550k
Peak memory use after GGC: 73715k
Maximum of released memory in single GGC run: 30212k -> 29700k
Garbage: 282755k -> 281021k
Leak: 9345k
Overhead: 35780k -> 35301k
GGC runs: 244 -> 241
comparing insn-attrtab.c compilation at -O3 level:
Overall memory allocated via mmap and sbrk increased from 105158k to 109182k, overall 3.83%
Overall memory needed: 105158k -> 109182k
Peak memory use before GGC: 79576k
Peak memory use after GGC: 73740k
Maximum of released memory in single GGC run: 30407k -> 29893k
Garbage: 283574k -> 281855k
Leak: 9350k
Overhead: 36008k -> 35530k
GGC runs: 247 -> 243
comparing Gerald's testcase PR8361 compilation at -O0 level:
Overall memory needed: 119066k
Peak memory use before GGC: 92331k -> 92333k
Peak memory use after GGC: 91417k
Maximum of released memory in single GGC run: 19248k -> 19249k
Garbage: 212896k -> 211566k
Leak: 48116k
Overhead: 21264k -> 21006k
GGC runs: 417 -> 416
comparing Gerald's testcase PR8361 compilation at -O0 -g level:
Overall memory needed: 131642k
Peak memory use before GGC: 104692k -> 104689k
Peak memory use after GGC: 103652k
Maximum of released memory in single GGC run: 18936k -> 18933k
Garbage: 219492k -> 218151k
Leak: 71548k
Overhead: 27169k -> 26910k
GGC runs: 390 -> 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: 442205k -> 441119k
Leak: 50183k -> 50190k
Overhead: 100280k -> 100032k
GGC runs: 562 -> 563
comparing Gerald's testcase PR8361 compilation at -O2 level:
Overall memory needed: 119558k
Peak memory use before GGC: 96693k
Peak memory use after GGC: 94490k
Maximum of released memory in single GGC run: 18081k
Garbage: 497579k -> 496369k
Leak: 51152k -> 51152k
Overhead: 58889k -> 58597k
GGC runs: 614 -> 616
comparing Gerald's testcase PR8361 compilation at -O3 level:
Overall memory needed: 121138k
Peak memory use before GGC: 97647k
Peak memory use after GGC: 96143k
Maximum of released memory in single GGC run: 18476k
Garbage: 517913k -> 516691k
Leak: 51126k
Overhead: 58884k -> 58568k
GGC runs: 620 -> 622
comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
Amount of memory still referenced at the end of compilation increased from 7542k to 8054k, overall 6.79%
Overall memory needed: 137290k -> 137638k
Peak memory use before GGC: 81587k
Peak memory use after GGC: 58467k
Maximum of released memory in single GGC run: 45166k -> 44559k
Garbage: 148528k -> 147003k
Leak: 7542k -> 8054k
Overhead: 25329k -> 24963k
GGC runs: 82 -> 80
comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
Overall memory needed: 138014k
Peak memory use before GGC: 82233k
Peak memory use after GGC: 59113k
Maximum of released memory in single GGC run: 45232k -> 44208k
Garbage: 148738k -> 147214k
Leak: 9309k
Overhead: 25824k -> 25458k
GGC runs: 88
comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
Overall memory needed: 421394k -> 422902k
Peak memory use before GGC: 199539k
Peak memory use after GGC: 193352k
Maximum of released memory in single GGC run: 112477k
Garbage: 287375k -> 286640k
Leak: 29778k
Overhead: 32193k -> 32103k
GGC runs: 98 -> 96
comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
Overall memory needed: 343394k -> 343302k
Peak memory use before GGC: 199532k
Peak memory use after GGC: 193345k
Maximum of released memory in single GGC run: 111908k
Garbage: 364381k -> 363700k
Leak: 30361k
Overhead: 47296k -> 47259k
GGC runs: 104 -> 103
comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
Overall memory allocated via mmap and sbrk increased from 749198k to 931458k, overall 24.33%
Overall memory needed: 749198k -> 931458k
Peak memory use before GGC: 317673k
Peak memory use after GGC: 296148k
Maximum of released memory in single GGC run: 186406k -> 172457k
Garbage: 504459k -> 501245k
Leak: 45414k
Overhead: 60272k -> 59242k
GGC runs: 99 -> 97
Head of the ChangeLog is:
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog 2006-12-23 19:10:29.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog 2006-12-24 12:51:18.000000000 +0000
@@ -1,3 +1,80 @@
+2006-12-24 Jan Hubicka <jh@suse.cz>
+
+ * tree-ssa-operands.h (struct ssa_operand_memory_d):
+ add ssa_operand_mem_size.
+ * tree-ssa-operands.c (operands_bitmap_obstack): New.
+ (ssa_operand_mem_size): Remove.
+ (init_ssa_operands): Initialize obstack; use it.
+ (fini_ssa_operands): Release obstack.
+ (ssa_operand_alloc): Update.
+ (finalize_ssa_vdefs, finalize_ssa_vuse_ops, copy_virtual_operands,
+ get_mpt_for): Use obstack.
+ * tree-ssa.c (delete_tree_ssa): Call fini_ssa_operands.
+ * tree-outof-ssa.c: (remove_ssa_form): Don't call it here.
+
+2006-12-24 Jan Hubicka <jh@suse.cz>
+
+ * tree-mudflap.c (ml_decl_cache_locals, md_build_check_statement_for):
+ add newly referenced vars.
+
+2006-12-24 Kazu Hirata <kazu@codesourcery.com>
+
+ * basic-block.h: Remove the prototype for
+ expected_value_to_br_prob.
+ * rtl.h: Remove the prototypes for expand_builtin_expect_jump
+ and purge_line_number_notes.
+
+2006-12-23 Zdenek Dvorak <dvorakz@suse.cz>
+
+ * tree-ssa-loop-niter.c (number_of_iterations_lt_to_ne,
+ assert_no_overflow_lt, assert_loop_rolls_lt,
+ number_of_iterations_lt, number_of_iterations_le,
+ number_of_iterations_cond, number_of_iterations_exit):
+ Use integer_zerop/integer_nonzerop instead of
+ null_or_integer_zerop/nonnull_and_integer_nonzerop.
+ * tree.h (null_or_integer_zerop, nonnull_and_integer_nonzerop):
+ Removed.
+ * tree-scalar-evolution.c (simple_iv): Return zero for step of
+ an invariant.
+ * tree-ssa-loop-ivopts.c (alloc_iv): Do not set step of invariants
+ to zero.
+ (get_iv): Return NULL for non-scalar types. Use zero as a step
+ of an invariant.
+ (determine_biv_step, find_interesting_uses_op,
+ find_interesting_uses_cond, find_interesting_uses_stmt,
+ add_old_ivs_candidates, determine_use_iv_cost_condition,
+ rewrite_use_compare, remove_unused_ivs):
+ Use integer_zerop instead of null_or_integer_zerop.
+ (struct ifs_ivopts_data): Replace step_p field with step field.
+ (idx_find_step): Use zero as a step of an invariant. Modify
+ step instead of *step_p.
+ (find_interesting_uses_address): Use zero as a step of an invariant.
+ Use integer_zerop instead of null_or_integer_zerop.
+ (find_interesting_uses_outside): Call find_interesting_uses_op only
+ for phi nodes for real operands.
+ (add_candidate_1): Expect step to be non-NULL.
+ * tree-ssa-loop-prefetch.c (idx_analyze_ref): Expect step to be
+ non-NULL.
+
+2006-12-23 Andrew Pinski <pinskia@gmail.com>
+
+ * vec.c: Don't include tree.h.
+ * Makefile.in (vec.o): Update dependencies.
+ (build/vec.o): Likewise.
+
+2006-12-23 Kazu Hirata <kazu@codesourcery.com>
+
+ * common.opt (flag_force_mem): Remove.
+ * doc/invoke.texi (-fforce-mem): Remove.
+ * opts.c (common_handle_option): Don't handle OPT_fforce_mem.
+
+ * Makefile.in (final.o): Depend on vecprim.h.
+ * final.c: Include vecprim.h.
+ (insn_addresses_): Change the type to VEC(int,heap)*.
+ * insn-addr.h (INSN_ADDRESSES_DEFN): Remove.
+ (INSN_ADDRESSES, INSN_ADDRESSES_ALLOC, INSN_ADDRESSES_SIZE,
+ INSN_ADDRESSES_NEW): Use VEC instead of VARRAY.
+
2006-12-23 Marcin Dalecki <martin@dalecki.de>
* cgraphunit.c (cgraph_optimize): Fixed obvious thinko in memory
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.