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, 09 Jan 2007 03:27:05 +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: 18333k -> 18337k
Peak memory use before GGC: 2263k
Peak memory use after GGC: 1954k
Maximum of released memory in single GGC run: 309k
Garbage: 444k -> 444k
Leak: 2287k
Overhead: 455k
GGC runs: 3
comparing empty function compilation at -O0 -g level:
Overall memory needed: 18353k
Peak memory use before GGC: 2291k
Peak memory use after GGC: 1981k
Maximum of released memory in single GGC run: 310k
Garbage: 447k -> 447k
Leak: 2320k
Overhead: 460k
GGC runs: 3
comparing empty function compilation at -O1 level:
Overall memory needed: 18445k
Peak memory use before GGC: 2263k
Peak memory use after GGC: 1954k
Maximum of released memory in single GGC run: 309k
Garbage: 450k -> 450k
Leak: 2290k
Overhead: 456k
GGC runs: 4
comparing empty function compilation at -O2 level:
Overall memory needed: 18457k
Peak memory use before GGC: 2264k
Peak memory use after GGC: 1954k
Maximum of released memory in single GGC run: 310k
Garbage: 453k -> 453k
Leak: 2290k
Overhead: 456k
GGC runs: 4
comparing empty function compilation at -O3 level:
Overall memory needed: 18457k
Peak memory use before GGC: 2264k
Peak memory use after GGC: 1954k
Maximum of released memory in single GGC run: 310k
Garbage: 453k -> 453k
Leak: 2290k
Overhead: 456k
GGC runs: 4
comparing combine.c compilation at -O0 level:
Overall memory needed: 28613k
Peak memory use before GGC: 9311k
Peak memory use after GGC: 8864k
Maximum of released memory in single GGC run: 2605k
Garbage: 37294k -> 37287k
Leak: 6538k
Overhead: 4829k -> 4829k
GGC runs: 277
comparing combine.c compilation at -O0 -g level:
Overall memory needed: 30665k
Peak memory use before GGC: 10894k
Peak memory use after GGC: 10523k
Maximum of released memory in single GGC run: 2365k
Garbage: 37887k -> 37869k
Leak: 9414k
Overhead: 5530k -> 5530k
GGC runs: 271
comparing combine.c compilation at -O1 level:
Overall memory needed: 33538k
Peak memory use before GGC: 20886k
Peak memory use after GGC: 20677k
Maximum of released memory in single GGC run: 2262k
Garbage: 55522k -> 55506k
Leak: 6566k -> 6565k
Overhead: 9977k -> 9978k
GGC runs: 352 -> 353
comparing combine.c compilation at -O2 level:
Amount of memory still referenced at the end of compilation increased from 6687k to 6695k, overall 0.12%
Overall memory needed: 33538k
Peak memory use before GGC: 20907k -> 20910k
Peak memory use after GGC: 20700k
Maximum of released memory in single GGC run: 2202k
Garbage: 71530k -> 71514k
Leak: 6687k -> 6695k
Overhead: 11895k -> 11897k
GGC runs: 407 -> 406
comparing combine.c compilation at -O3 level:
Overall memory needed: 32766k
Peak memory use before GGC: 21970k -> 21967k
Peak memory use after GGC: 21365k -> 21362k
Maximum of released memory in single GGC run: 3135k
Garbage: 104671k -> 104613k
Leak: 6768k -> 6768k
Overhead: 16598k -> 16596k
GGC runs: 464
comparing insn-attrtab.c compilation at -O0 level:
Overall memory needed: 89190k
Peak memory use before GGC: 70731k
Peak memory use after GGC: 44749k
Maximum of released memory in single GGC run: 37356k
Garbage: 131555k -> 131555k
Leak: 9579k
Overhead: 16626k
GGC runs: 210
comparing insn-attrtab.c compilation at -O0 -g level:
Overall memory needed: 90366k
Peak memory use before GGC: 71892k
Peak memory use after GGC: 46017k
Maximum of released memory in single GGC run: 37356k
Garbage: 132720k -> 132720k
Leak: 11268k
Overhead: 17020k
GGC runs: 209
comparing insn-attrtab.c compilation at -O1 level:
Overall memory needed: 100958k -> 100702k
Peak memory use before GGC: 76173k -> 75640k
Peak memory use after GGC: 72305k -> 71772k
Maximum of released memory in single GGC run: 31284k
Garbage: 229283k -> 229017k
Leak: 9404k
Overhead: 29492k -> 29492k
GGC runs: 219
comparing insn-attrtab.c compilation at -O2 level:
Ovarall memory allocated via mmap and sbrk decreased from 112622k to 107418k, overall -4.84%
Overall memory needed: 112622k -> 107418k
Peak memory use before GGC: 83860k -> 83327k
Peak memory use after GGC: 78024k -> 77491k
Maximum of released memory in single GGC run: 29572k
Garbage: 281115k -> 280842k
Leak: 9401k
Overhead: 35349k -> 35350k
GGC runs: 241
comparing insn-attrtab.c compilation at -O3 level:
Ovarall memory allocated via mmap and sbrk decreased from 112634k to 107446k, overall -4.83%
Overall memory needed: 112634k -> 107446k
Peak memory use before GGC: 83900k -> 83367k
Peak memory use after GGC: 78065k -> 77531k
Maximum of released memory in single GGC run: 29761k -> 29760k
Garbage: 281946k -> 281673k
Leak: 9406k
Overhead: 35580k -> 35580k
GGC runs: 242
comparing Gerald's testcase PR8361 compilation at -O0 level:
Overall memory needed: 119830k
Peak memory use before GGC: 93043k
Peak memory use after GGC: 92119k
Maximum of released memory in single GGC run: 18913k
Garbage: 208225k -> 208221k
Leak: 49014k -> 49014k
Overhead: 21199k -> 21199k
GGC runs: 407
comparing Gerald's testcase PR8361 compilation at -O0 -g level:
Overall memory needed: 132298k
Peak memory use before GGC: 105317k
Peak memory use after GGC: 104273k
Maximum of released memory in single GGC run: 18749k
Garbage: 214828k -> 214812k
Leak: 72442k -> 72442k
Overhead: 27105k -> 27105k
GGC runs: 382
comparing Gerald's testcase PR8361 compilation at -O1 level:
Overall memory needed: 139602k
Peak memory use before GGC: 112868k -> 112866k
Peak memory use after GGC: 111747k -> 111746k
Maximum of released memory in single GGC run: 17926k
Garbage: 438004k -> 437399k
Leak: 51042k -> 51042k
Overhead: 99344k -> 99333k
GGC runs: 584 -> 585
comparing Gerald's testcase PR8361 compilation at -O2 level:
Overall memory needed: 139638k -> 139650k
Peak memory use before GGC: 112895k -> 112892k
Peak memory use after GGC: 111773k -> 111774k
Maximum of released memory in single GGC run: 17926k
Garbage: 492373k -> 491488k
Leak: 52004k -> 52007k
Overhead: 58677k -> 58595k
GGC runs: 633 -> 632
comparing Gerald's testcase PR8361 compilation at -O3 level:
Overall memory needed: 141514k -> 141518k
Peak memory use before GGC: 114685k -> 114674k
Peak memory use after GGC: 113482k
Maximum of released memory in single GGC run: 18326k
Garbage: 512889k -> 511991k
Leak: 51976k -> 51976k
Overhead: 58612k -> 58665k
GGC runs: 643 -> 644
comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
Overall memory needed: 137646k
Peak memory use before GGC: 81607k
Peak memory use after GGC: 58486k
Maximum of released memory in single GGC run: 44560k
Garbage: 148154k -> 148154k
Leak: 8080k
Overhead: 25066k
GGC runs: 81
comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
Overall memory needed: 138198k
Peak memory use before GGC: 82252k
Peak memory use after GGC: 59132k
Maximum of released memory in single GGC run: 44208k
Garbage: 148373k -> 148372k
Leak: 9335k
Overhead: 25561k
GGC runs: 89
comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
Overall memory needed: 417738k -> 417906k
Peak memory use before GGC: 200847k
Peak memory use after GGC: 193545k
Maximum of released memory in single GGC run: 112452k
Garbage: 282085k -> 282084k
Leak: 29804k
Overhead: 32000k
GGC runs: 91
comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
Overall memory needed: 342026k -> 342374k
Peak memory use before GGC: 200842k
Peak memory use after GGC: 193540k
Maximum of released memory in single GGC run: 111878k
Garbage: 359138k -> 359138k
Leak: 30387k
Overhead: 47155k
GGC runs: 101
comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
Overall memory needed: 923250k -> 923342k
Peak memory use before GGC: 317309k
Peak memory use after GGC: 295751k
Maximum of released memory in single GGC run: 168455k
Garbage: 494906k -> 494906k
Leak: 45439k
Overhead: 59089k
GGC runs: 97
Head of the ChangeLog is:
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog 2007-01-08 10:45:58.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog 2007-01-09 01:38:07.000000000 +0000
@@ -1,3 +1,143 @@
+2007-01-08 Richard Guenther <rguenther@suse.de>
+
+ * tree.h (force_fit_type_double): Export.
+ (force_fit_type): Remove.
+ * fold-const.c (force_fit_type_double): New function.
+ (force_fit_type): Remove.
+ (int_const_binop): Use it.
+ (fold_convert_const_int_from_int): Likewise.
+ (fold_convert_const_int_from_real): Likewise.
+ (fold_div_compare): Likewise.
+ (fold_sign_changed_comparison): Likewise.
+ (fold_unary): Likewise.
+ (fold_negate_const): Likewise.
+ (fold_abs_const): Likewise.
+ (fold_not_const): Likewise.
+ * c-common.c (shorten_compare): Use force_fit_type_double.
+ * convert.c (convert_to_pointer): Likewise.
+
+2007-01-08 Richard Guenther <rguenther@suse.de>
+
+ * tree.h (build_int_cst_wide_type): Export.
+ * tree.c (build_int_cst_wide_type): New function.
+ (build_int_cst_wide): Fix comment.
+ * builtins.c (fold_builtin_object_size): Use build_int_cst
+ to build -1 or 0 of the correct type. Use fit_double_type
+ to check for overflow.
+ * fold-const.c (optimize_bit_field_compare): Use build_int_cst_type
+ to build the mask.
+ (decode_field_reference): Likewise.
+ (all_ones_mask_p): Likewise.
+ (native_interpret_int): Use build_int_cst_wide_type.
+ (fold_binary): Use build_int_cst_type to build an all-ones
+ value.
+ * stor-layout.c (set_sizetype): Use build_int_cst_wide_type.
+
+2007-01-08 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * config/pa/t-pa64 (libgcc_stub.a): Use $(T).
+
+2007-01-09 Ben Elliston <bje@au.ibm.com>
+
+ * genautomata.c (STATS_OPTION): New option.
+ (stats_flag): New flag.
+ (gen_automata_option): Handle it.
+ (initiate_automaton_gen): Ditto.
+ (write_automata): Output statistics only if stats_flag is
+ set. Likewise, output time statistics only if time_flag is set.
+ * doc/md.texi (Processor pipeline description): Document new flag.
+
+2007-01-08 Richard Guenther <rguenther@suse.de>
+
+ * builtins.c (fold_builtin_int_roundingfn): Use fit_double_type.
+ * tree.c (build_int_cst_type): Likewise.
+ (size_in_bytes): Don't call force_fit_type on the result.
+ (int_fits_type_p): Use fit_double_type.
+ * fold-const.c (fit_double_type): New function.
+ (force_fit_type): Use it.
+ * tree.h (fit_double_type): Export.
+
+2007-01-08 Jan Hubicka <jh@suse.cz>
+
+ * tree-vectorizer.c (gate_increase_alignment): Fix return type.
+ * ipa.c (function_and_variable_visibility): Fix return type.
+
+2007-01-08 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Use type
+ of offset to build the index.
+ * tree-pretty-print.c (dump_generic_node): Don't build negated
+ const just for printing.
+ * c-pretty-print.c (pp_c_integer_constant): Likewise.
+ * builtins.c (fold_builtin_int_roundingfn): Check if result
+ fits the type by using force_fit_type and comparing the result.
+ * predict.c (predict_loops): Use compare_tree_int for comparison.
+ * tree.c (build_int_cst): Fall back to integer_type_node for
+ NULL_TREE type.
+ (build_int_cst_wide): Assert type is non-null.
+
+2007-01-08 Roberto Costa <roberto.costa@st.com>
+
+ * tree-vrp.c (extract_range_from_cond_expr): New.
+ (extract_range_from_expr): Handle COND_EXPR nodes used as expressions.
+ * tree-ssa-ccp.c (get_maxval_strlen): Handle COND_EXPR nodes used
+ as expressions.
+ (fold_stmt): Bug fix, avoid infinite recursion when folding COND_EXPRs.
+ * tree-ssa-forwprop.c (simplify_cond, forward_propagate_into_cond,
+ tree_ssa_forward_propagate_single_use_vars): Handle COND_EXPR nodes
+ used as expressions.
+ * tree-object-size.c (cond_expr_object_size): New.
+ (collect_object_sizes_for): Handle COND_EXPR nodes used as expressions.
+
+2007-01-08 Jan Hubicka <jh@suse.cz>
+
+ * tree-ssa-forwprop.c (forward_propagate_into_cond,
+ tree_ssa_forward_propagate_single_use_va): Release defs of propagated
+ statement.
+
+2007-01-08 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/23603
+ * tree-vrp.c (set_value_range_to_truthvalue): New function.
+ (extract_range_from_binary): Fall back to truthvalue instead of
+ varying for TRUTH_*_EXPR.
+ (extract_range_from_comparison): Fall back to truthvalue instead of
+ varying.
+ (vrp_visit_phi_node): Don't adjust new range bounds to +INF/-INF
+ if all visited PHI values were constant.
+
+2007-01-08 Jan Hubicka <jh@suse.cz>
+
+ * cgraphunit.c (cgraph_process_new_functions): Reset reachable flag.
+ (cgraph_analyze_function): break out from ...
+ (cgraph_finalize_compilation_unit): ... here.
+ (cgraph_expand_function): Remove forgoten commented out line.
+ (cgraph_optimize): Analyze functions.
+
+2007-01-08 Jan Hubicka <jh@suse.cz>
+
+ * tree-pas.h (TODO_remove_function): New flag.
+ (TODO_update*): Renumber.
+ (pass_ipa_increase_alignment,
+ pass_ipa_function_and_variable_visibility): New passes.
+ * cgraphunit.c (cgraph_increase_alignment): Move to tree-vectorizer.c
+ (cgraph_function_and_variable_visibility): Move to ipa.c
+ (cgraph_optimize): Don't call cgraph_function_and_variable_visibility,
+ cgraph_increase_alignment.
+ * ipa-inline.c (cgraph_decide_inlining): Don't push timevar.
+ (cgraph_decide_inlining_incrementally): Push TV_INTEGRATION before
+ calling tree-inline.
+ (cgraph_early_inlining): Do not call cgraph_remove_unreachable_nodes.
+ (pass_ipa_inline, pass_early_ipa_inlining): Set TODO_remove_functions
+ * tree-vectorizer.c (increase_alignment): Move here from cgraphunit.c
+ (gate_increase_alignment): New function.
+ (pass_ipa_increase_alignment): New pass.
+ * ipa.c: Inline tree-pass.h and timevar.h
+ (function_and_variable_visibility): Move here from cgraphunit.c
+ * tree-optimize.c (pass_early_local_passes): Add TODO_remove_functions.
+ * passes.c (init_optimization_passes): Add the two new passes.
+ (execute_todo): Handle cgraph_remove_functions.
+
2007-01-08 Nick Clifton <nickc@redhat.com>
* config/frv/predicates.md (reg_or_0_operand): Accept
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp 2007-01-08 10:45:57.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog 2007-01-09 01:38:06.000000000 +0000
@@ -1,3 +1,7 @@
+2007-01-08 Richard Guenther <rguenther@suse.de>
+
+ * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
+
2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
* call.c (standard_conversion): Pass flag to
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.