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: Wed, 29 Nov 2006 05:29:41 +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:
Amount of produced GGC garbage increased from 421k to 422k, overall 0.14%
Overall memory needed: 18273k -> 18277k
Peak memory use before GGC: 2233k
Peak memory use after GGC: 1940k
Maximum of released memory in single GGC run: 293k
Garbage: 421k -> 422k
Leak: 2271k -> 2271k
Overhead: 446k -> 446k
GGC runs: 3
comparing empty function compilation at -O0 -g level:
Amount of produced GGC garbage increased from 424k to 425k, overall 0.14%
Overall memory needed: 18289k -> 18293k
Peak memory use before GGC: 2260k
Peak memory use after GGC: 1967k
Maximum of released memory in single GGC run: 293k
Garbage: 424k -> 425k
Leak: 2303k -> 2303k
Overhead: 450k -> 450k
GGC runs: 3
comparing empty function compilation at -O1 level:
Amount of produced GGC garbage increased from 427k to 427k, overall 0.15%
Overall memory needed: 18373k -> 18377k
Peak memory use before GGC: 2233k
Peak memory use after GGC: 1940k
Maximum of released memory in single GGC run: 293k
Garbage: 427k -> 427k
Leak: 2274k -> 2274k
Overhead: 446k -> 446k
GGC runs: 4
comparing empty function compilation at -O2 level:
Amount of produced GGC garbage increased from 430k to 431k, overall 0.15%
Overall memory needed: 18385k -> 18389k
Peak memory use before GGC: 2233k
Peak memory use after GGC: 1940k
Maximum of released memory in single GGC run: 293k
Garbage: 430k -> 431k
Leak: 2274k -> 2274k
Overhead: 447k -> 447k
GGC runs: 4
comparing empty function compilation at -O3 level:
Amount of produced GGC garbage increased from 430k to 431k, overall 0.15%
Overall memory needed: 18385k -> 18389k
Peak memory use before GGC: 2233k
Peak memory use after GGC: 1940k
Maximum of released memory in single GGC run: 293k
Garbage: 430k -> 431k
Leak: 2274k -> 2274k
Overhead: 447k -> 447k
GGC runs: 4
comparing combine.c compilation at -O0 level:
Overall memory needed: 28477k -> 28481k
Peak memory use before GGC: 9313k -> 9315k
Peak memory use after GGC: 8852k -> 8854k
Maximum of released memory in single GGC run: 2665k -> 2666k
Garbage: 36831k -> 36864k
Leak: 6480k -> 6466k
Overhead: 4867k -> 4873k
GGC runs: 280
comparing combine.c compilation at -O0 -g level:
Peak amount of GGC memory allocated before garbage collecting increased from 10863k to 10884k, overall 0.19%
Peak amount of GGC memory still allocated after garbage collectin increased from 10493k to 10514k, overall 0.20%
Amount of memory still referenced at the end of compilation increased from 9274k to 9358k, overall 0.90%
Overall memory needed: 30569k -> 30577k
Peak memory use before GGC: 10863k -> 10884k
Peak memory use after GGC: 10493k -> 10514k
Maximum of released memory in single GGC run: 2415k
Garbage: 37427k -> 37428k
Leak: 9274k -> 9358k
Overhead: 5535k -> 5574k
GGC runs: 271 -> 272
comparing combine.c compilation at -O1 level:
Overall memory needed: 40305k -> 40309k
Peak memory use before GGC: 17306k -> 17308k
Peak memory use after GGC: 17131k -> 17133k
Maximum of released memory in single GGC run: 2328k -> 2329k
Garbage: 57465k -> 57501k
Leak: 6524k -> 6514k
Overhead: 6224k -> 6232k
GGC runs: 355
comparing combine.c compilation at -O2 level:
Overall memory needed: 29810k
Peak memory use before GGC: 17299k -> 17302k
Peak memory use after GGC: 17128k -> 17131k
Maximum of released memory in single GGC run: 2869k -> 2870k
Garbage: 74904k -> 74941k
Leak: 6614k -> 6619k
Overhead: 8475k -> 8486k
GGC runs: 412
comparing combine.c compilation at -O3 level:
Overall memory needed: 28910k
Peak memory use before GGC: 18428k -> 18429k
Peak memory use after GGC: 17856k -> 17857k
Maximum of released memory in single GGC run: 4096k -> 4097k
Garbage: 112606k -> 112654k
Leak: 6686k -> 6677k
Overhead: 13020k -> 13026k
GGC runs: 462
Overall memory needed: 28477k -> 28481k
Peak memory use before GGC: 9313k -> 9315k
Peak memory use after GGC: 8852k -> 8854k
Maximum of released memory in single GGC run: 2665k -> 2666k
Garbage: 36831k -> 36864k
Leak: 6480k -> 6466k
Overhead: 4867k -> 4873k
GGC runs: 280
comparing combine.c compilation at -O1 level:
Overall memory needed: 40305k -> 40309k
Peak memory use before GGC: 17306k -> 17308k
Peak memory use after GGC: 17131k -> 17133k
Maximum of released memory in single GGC run: 2328k -> 2329k
Garbage: 57465k -> 57501k
Leak: 6524k -> 6514k
Overhead: 6224k -> 6232k
GGC runs: 355
comparing combine.c compilation at -O2 level:
Overall memory needed: 29810k
Peak memory use before GGC: 17299k -> 17302k
Peak memory use after GGC: 17128k -> 17131k
Maximum of released memory in single GGC run: 2869k -> 2870k
Garbage: 74904k -> 74941k
Leak: 6614k -> 6619k
Overhead: 8475k -> 8486k
GGC runs: 412
comparing combine.c compilation at -O3 level:
Overall memory needed: 28910k
Peak memory use before GGC: 18428k -> 18429k
Peak memory use after GGC: 17856k -> 17857k
Maximum of released memory in single GGC run: 4096k -> 4097k
Garbage: 112606k -> 112654k
Leak: 6686k -> 6677k
Overhead: 13020k -> 13026k
GGC runs: 462
comparing insn-attrtab.c compilation at -O0 level:
Amount of produced GGC garbage increased from 129062k to 129330k, overall 0.21%
Overall memory needed: 88246k
Peak memory use before GGC: 69795k -> 69796k
Peak memory use after GGC: 44205k -> 44206k
Maximum of released memory in single GGC run: 36964k
Garbage: 129062k -> 129330k
Leak: 9522k -> 9283k
Overhead: 17001k -> 17004k
GGC runs: 216
comparing insn-attrtab.c compilation at -O0 -g level:
Amount of memory still referenced at the end of compilation increased from 10943k to 10990k, overall 0.43%
Overall memory needed: 89430k -> 89426k
Peak memory use before GGC: 70944k -> 70957k
Peak memory use after GGC: 45461k -> 45473k
Maximum of released memory in single GGC run: 36964k -> 36965k
Garbage: 130473k -> 130486k
Leak: 10943k -> 10990k
Overhead: 17379k -> 17399k
GGC runs: 212
comparing insn-attrtab.c compilation at -O1 level:
Overall memory needed: 114194k -> 112894k
Peak memory use before GGC: 90380k -> 90381k
Peak memory use after GGC: 83742k -> 83743k
Maximum of released memory in single GGC run: 31852k
Garbage: 277773k -> 277793k
Leak: 9363k -> 9361k
Overhead: 29791k -> 29779k
GGC runs: 221
comparing insn-attrtab.c compilation at -O2 level:
Ovarall memory allocated via mmap and sbrk decreased from 129350k to 124546k, overall -3.86%
Overall memory needed: 129350k -> 124546k
Peak memory use before GGC: 92609k -> 92610k
Peak memory use after GGC: 84721k -> 84722k
Maximum of released memory in single GGC run: 30397k
Garbage: 317194k -> 317215k
Leak: 9365k -> 9363k
Overhead: 36370k -> 36358k
GGC runs: 243
comparing insn-attrtab.c compilation at -O3 level:
Ovarall memory allocated via mmap and sbrk decreased from 129370k to 124558k, overall -3.86%
Overall memory needed: 129370k -> 124558k
Peak memory use before GGC: 92636k
Peak memory use after GGC: 84748k -> 84749k
Maximum of released memory in single GGC run: 30585k -> 30586k
Garbage: 318051k -> 318072k
Leak: 9368k -> 9366k
Overhead: 36605k -> 36593k
GGC runs: 247
comparing Gerald's testcase PR8361 compilation at -O0 level:
Peak amount of GGC memory allocated before garbage collecting increased from 93193k to 93337k, overall 0.15%
Peak amount of GGC memory still allocated after garbage collectin increased from 92260k to 92402k, overall 0.15%
Amount of produced GGC garbage increased from 207571k to 208315k, overall 0.36%
Amount of memory still referenced at the end of compilation increased from 47752k to 47803k, overall 0.11%
Overall memory needed: 119898k -> 119894k
Peak memory use before GGC: 93193k -> 93337k
Peak memory use after GGC: 92260k -> 92402k
Maximum of released memory in single GGC run: 19356k -> 19428k
Garbage: 207571k -> 208315k
Leak: 47752k -> 47803k
Overhead: 20921k -> 21149k
GGC runs: 408 -> 409
comparing Gerald's testcase PR8361 compilation at -O0 -g level:
Peak amount of GGC memory allocated before garbage collecting increased from 106437k to 106742k, overall 0.29%
Peak amount of GGC memory still allocated after garbage collectin increased from 105383k to 105679k, overall 0.28%
Amount of produced GGC garbage increased from 214171k to 214897k, overall 0.34%
Amount of memory still referenced at the end of compilation increased from 70714k to 71322k, overall 0.86%
Overall memory needed: 133518k -> 133514k
Peak memory use before GGC: 106437k -> 106742k
Peak memory use after GGC: 105383k -> 105679k
Maximum of released memory in single GGC run: 20416k -> 20492k
Garbage: 214171k -> 214897k
Leak: 70714k -> 71322k
Overhead: 26537k -> 27054k
GGC runs: 380
comparing Gerald's testcase PR8361 compilation at -O1 level:
Amount of produced GGC garbage increased from 446720k to 447491k, overall 0.17%
Overall memory needed: 119490k -> 119526k
Peak memory use before GGC: 98256k -> 98312k
Peak memory use after GGC: 95974k -> 96027k
Maximum of released memory in single GGC run: 18601k -> 18671k
Garbage: 446720k -> 447491k
Leak: 49756k -> 49669k
Overhead: 32635k -> 32850k
GGC runs: 559
comparing Gerald's testcase PR8361 compilation at -O2 level:
Amount of produced GGC garbage increased from 504692k to 505474k, overall 0.15%
Overall memory needed: 119350k -> 119402k
Peak memory use before GGC: 98072k -> 98127k
Peak memory use after GGC: 95790k -> 95842k
Maximum of released memory in single GGC run: 18623k -> 18694k
Garbage: 504692k -> 505474k
Leak: 50418k -> 50337k
Overhead: 39649k -> 39829k
GGC runs: 620 -> 619
comparing Gerald's testcase PR8361 compilation at -O3 level:
Amount of produced GGC garbage increased from 526931k to 527629k, overall 0.13%
Overall memory needed: 119458k -> 119462k
Peak memory use before GGC: 98048k -> 98103k
Peak memory use after GGC: 97077k -> 97129k
Maximum of released memory in single GGC run: 19002k -> 19074k
Garbage: 526931k -> 527629k
Leak: 50373k -> 50311k
Overhead: 40791k -> 40992k
GGC runs: 627 -> 628
comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
Overall memory needed: 137962k -> 137966k
Peak memory use before GGC: 81913k
Peak memory use after GGC: 58793k
Maximum of released memory in single GGC run: 45493k -> 45494k
Garbage: 147243k -> 147248k
Leak: 7541k -> 7541k
Overhead: 25304k -> 25306k
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 9249k to 9309k, overall 0.65%
Overall memory needed: 138138k
Peak memory use before GGC: 82546k -> 82559k
Peak memory use after GGC: 59426k -> 59439k
Maximum of released memory in single GGC run: 45559k
Garbage: 147414k -> 147419k
Leak: 9249k -> 9309k
Overhead: 25769k -> 25801k
GGC runs: 88
comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
Amount of produced GGC garbage increased from 272489k to 291921k, overall 7.13%
Amount of memory still referenced at the end of compilation decreased from 49254k to 30049k, overall -63.91%
Overall memory needed: 427910k -> 428002k
Peak memory use before GGC: 206841k
Peak memory use after GGC: 202617k
Maximum of released memory in single GGC run: 101927k
Garbage: 272489k -> 291921k
Leak: 49254k -> 30049k
Overhead: 31427k -> 31503k
GGC runs: 99
comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
Amount of produced GGC garbage increased from 352464k to 370509k, overall 5.12%
Amount of memory still referenced at the end of compilation decreased from 48189k to 30372k, overall -58.66%
Overall memory needed: 351734k -> 351542k
Peak memory use before GGC: 206006k
Peak memory use after GGC: 201782k
Maximum of released memory in single GGC run: 108819k
Garbage: 352464k -> 370509k
Leak: 48189k -> 30372k
Overhead: 46953k -> 47028k
GGC runs: 110
comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
Amount of produced GGC garbage increased from 494498k to 514857k, overall 4.12%
Amount of memory still referenced at the end of compilation decreased from 65522k to 45424k, overall -44.24%
Overall memory needed: 781218k -> 780930k
Peak memory use before GGC: 314929k
Peak memory use after GGC: 293272k
Maximum of released memory in single GGC run: 165210k
Garbage: 494498k -> 514857k
Leak: 65522k -> 45424k
Overhead: 59799k -> 59887k
GGC runs: 98
Head of the ChangeLog is:
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog 2006-11-28 11:12:55.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog 2006-11-29 03:43:27.000000000 +0000
@@ -1,3 +1,113 @@
+2006-11-28 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/lib1funcs.asm (__umulsidi3): Restore a12-a15 on exit.
+
+2006-11-28 Jan Hubicka <jh@suse.cz>
+
+ Privatize SSA variables into gimple_df.
+ * tree-flow-inline.h
+ (gimple_in_ssa_p, gimple_aliases_computed_p, gimple_addressable_vars,
+ gimple_call_clobbered_vars, gimple_referenced_vars, gimple_global_var,
+ gimple_nonlocal_all): New accessors.
+ (first_referenced_var): Update.
+ (mark_stmt_modified): Update.
+ (is_call_clobbered): Update.
+ (mark_call_clobbered): Update.
+ (clear_call_clobbered): Update.
+ (mark_non_addressable): Update.
+ * tree-vrp.c (get_value_range): Update.
+ * tree-into-ssa.c (in_ssa_p): Kill.
+ (get_default_def_for): Update.
+ (rewrite_into_ssa): Update.
+ * tree-complex.c (init_parameter_lattice_values): Update.
+ (update_complex_assignment): Update.
+ (update_parameter_components): Update.
+ (expand_complex_libcall): Update.
+ (expand_complex_operations_1): Update.
+ * tree-tailcall.c (arg_needs_copy_p): Update.
+ (add_virtual_phis): Update.
+ (tree_optimize_tail_calls_1): Update.
+ * tree-ssa-dse.c (memory_ssa_name_same): Update.
+ * tree-ssa-copyrename.c
+ (copy_rename_partition_coalesce): Update.
+ * tree-ssa-math-opts.c (execute_cse_reciprocals): Update.
+ * tree-ssa-propagate.c (set_rhs): Update.
+ * tree-ssa-alias.c (aliases_computed_p, call_clobbered_vars,
+ addressable_vars, global_var):Kill.
+ (set_initial_properties): Update.
+ (init_alias_info): Update.
+ (finalize_ref_all_pointers): Update.
+ (setup_pointers_and_addressables): Update.
+ (maybe_create_global_var): Update.
+ (create_global_var): Update.
+ (dump_points_to_info): Update.
+ * function.h (struct gimple_df): Forward declare.
+ (struct function): Add GIMPLE_DF field.
+ * gimplify.c (force_gimple_operand): Update.
+ * tree-dfa.c (referenced_vars, default_defs): KIll.
+ (make_rename_temp): Update.
+ (dump_variable): Update.
+ (referenced_var_lookup): Update.
+ (referenced_var_check_and_insert): Update.
+ (default_def): Rename to ...
+ (gimple_default_def): ... this one; accept cfun argument.
+ (set_default_def): Update.
+ * tree-cfgcleanup.c (modified_noreturn_calls): Kill.
+ (cleanup_control_flow): Update.
+ * tree-ssa-pre.c (compute_avail): Update
+ * tree-ssa-live.c (calculate_live_on_entry): Update.
+ * tree-ssa.c (verify_use): Update.
+ (verify_call_clobbering): Update.
+ (verify_call_clobbering): Update.
+ (init_tree_ssa): Update.
+ (delete_tree_ssa): Update.
+ * tree-outof-ssa.c (coalesce_ssa_name): Update.
+ (rewrite_out_of_ssa): Update.
+ * tree-flow.h (gimple_df): New structure collecting dataflow variables.
+ (FREE_SSANAMES, SSANAMES, MODIFIED_NORETURN_CALLS, DEFAULT_DEFS): New
+ private accessors.
+ (in_ssa_p, modified_noreturn_calls, referenced_vars, default_defs,
+ ssa_names, global_var, nonlocal_all, call_clobbered_vars,
+ addressable_vars, aliases_computed_p): Kill.
+ (default_def): Rename to...
+ (gimple_default_def): ... this one.
+ (defaule_def_fn): Kill.
+ (num_referenced_vars, ssa_names, num_ssa_names): Update.
+ * tree-ssa-structalias.c (nonlocal_all): Kill.
+ (get_constraint_exp_from_ssa_var): Update.
+ (create_nonlocal_var): Update.
+ (get_constraint_for): Update.
+ (update_alias_info): Update.
+ (find_global_initializers): Update.
+ (intra_create_variable_infos): Update.
+ (intra_create_variable_infos):
+ (find_what_p_points_to): Update.
+ (init_alias_heapvars): Update.
+ * tree-cfg.c (remove_bb): Update.
+ (gimplify_val): Update.
+ * tree-ssa-reassoc.c (get_rank): Update.
+ (init_reassoc): Update.
+ * tree-ssanames.c: Do not include gt-tree-ssanames.h
+ (ssa_names, free_ssanames): Kill.
+ (init_ssanames): Update.
+ (make_ssa_name): Update.
+ (release_ssa_name): Update.
+ (release_defs): Update.
+ (replace_ssa_name_symbol): Update.
+ * tree-ssa-operands.c (access_can_touch_variable): Update.
+ (add_virtual_operand): Update.
+ (add_call_clobber_ops): Update.
+ (add_call_read_ops): Update.
+ (get_call_expr_operands): Update.
+ (get_asm_expr_operands): Update.
+
+2006-11-28 Jan Hubicka <jh@suse.cz>
+
+ * builtins.c: Include tree-flow.h.
+ (fold_builtin_memory_op): Be more aggressive on converting memcpy to
+ assignment; convert memmove to memcpy for sizes greater than 1 where
+ alignment of operands prohibit the partial overlap.
+
2006-11-28 Jan Hubicka <jh@suse.cz>
* invoke.texi (large-stack-frame, large-stack-frame-growth): New params.
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp 2006-11-28 11:12:55.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog 2006-11-29 03:43:20.000000000 +0000
@@ -1,3 +1,9 @@
+2006-11-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/29735
+ * decl.c (grokfndecl): Check main's type after applying
+ attributes, not before.
+
2006-11-27 Mark Mitchell <mark@codesourcery.com>
* class.c (build_vcall_offset_vtbl_entries): Do not add vcall
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.