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 combine.c compilation at -O0 level:
  Overall memory allocated via mmap and sbrk increased from 23769k to 24837k, overall 4.49%
    Overall memory needed: 23769k -> 24837k
    Peak memory use before GGC: 9590k
    Peak memory use after GGC: 8937k
    Maximum of released memory in single GGC run: 2754k
    Garbage: 41361k
    Leak: 6690k
    Overhead: 5813k
    GGC runs: 320

comparing combine.c compilation at -O1 level:
    Overall memory needed: 26812k
    Peak memory use before GGC: 17362k
    Peak memory use after GGC: 17173k
    Maximum of released memory in single GGC run: 2402k -> 2398k
    Garbage: 66361k -> 66109k
    Leak: 7195k -> 7196k
    Overhead: 7737k -> 7643k
    GGC runs: 415

comparing combine.c compilation at -O2 level:
  Amount of produced GGC garbage decreased from 84481k to 81102k, overall -4.17%
    Overall memory needed: 26812k
    Peak memory use before GGC: 17365k
    Peak memory use after GGC: 17173k
    Maximum of released memory in single GGC run: 2504k -> 2503k
    Garbage: 84481k -> 81102k
    Leak: 7436k -> 7438k
    Overhead: 10280k -> 9940k
    GGC runs: 481 -> 477

comparing combine.c compilation at -O3 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 17615k to 18455k, overall 4.77%
  Peak amount of GGC memory still allocated after garbage collectin increased from 17173k to 18100k, overall 5.40%
  Amount of memory still referenced at the end of compilation increased from 7506k to 7547k, overall 0.54%
    Overall memory needed: 26812k
    Peak memory use before GGC: 17615k -> 18455k
    Peak memory use after GGC: 17173k -> 18100k
    Maximum of released memory in single GGC run: 3353k -> 3539k
    Garbage: 115530k -> 114991k
    Leak: 7506k -> 7547k
    Overhead: 13498k -> 13539k
    GGC runs: 535 -> 546

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 81648k
    Peak memory use before GGC: 70263k
    Peak memory use after GGC: 45002k
    Maximum of released memory in single GGC run: 37047k
    Garbage: 148647k
    Leak: 10091k
    Overhead: 19857k
    GGC runs: 250

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 112552k -> 112156k
    Peak memory use before GGC: 94389k
    Peak memory use after GGC: 83710k
    Maximum of released memory in single GGC run: 32776k -> 32765k
    Garbage: 294413k -> 294363k
    Leak: 10080k -> 10081k
    Overhead: 36804k -> 36813k
    GGC runs: 250

comparing insn-attrtab.c compilation at -O2 level:
  Peak amount of GGC memory allocated before garbage collecting run decreased from 113436k to 94518k, overall -20.02%
  Peak amount of GGC memory still allocated after garbage collectin increased from 83674k to 83886k, overall 0.25%
  Amount of produced GGC garbage decreased from 380610k to 339826k, overall -12.00%
    Overall memory needed: 123328k -> 120172k
    Peak memory use before GGC: 113436k -> 94518k
    Peak memory use after GGC: 83674k -> 83886k
    Maximum of released memory in single GGC run: 32461k -> 32713k
    Garbage: 380610k -> 339826k
    Leak: 10194k -> 10092k
    Overhead: 48618k -> 45059k
    GGC runs: 279 -> 278

comparing insn-attrtab.c compilation at -O3 level:
  Peak amount of GGC memory allocated before garbage collecting run decreased from 113461k to 94539k, overall -20.02%
  Peak amount of GGC memory still allocated after garbage collectin increased from 83698k to 83907k, overall 0.25%
  Amount of produced GGC garbage decreased from 381139k to 340371k, overall -11.98%
    Overall memory needed: 123336k -> 120260k
    Peak memory use before GGC: 113461k -> 94539k
    Peak memory use after GGC: 83698k -> 83907k
    Maximum of released memory in single GGC run: 32776k -> 33028k
    Garbage: 381139k -> 340371k
    Leak: 10210k -> 10108k
    Overhead: 48672k -> 45113k
    GGC runs: 282 -> 281

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 118616k
    Peak memory use before GGC: 95321k
    Peak memory use after GGC: 94374k
    Maximum of released memory in single GGC run: 20159k
    Garbage: 227542k
    Leak: 49361k
    Overhead: 36908k
    GGC runs: 344

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Amount of produced GGC garbage increased from 599430k to 606485k, overall 1.18%
  Amount of memory still referenced at the end of compilation increased from 55582k to 55639k, overall 0.10%
    Overall memory needed: 105532k
    Peak memory use before GGC: 94274k
    Peak memory use after GGC: 93338k
    Maximum of released memory in single GGC run: 19336k
    Garbage: 599430k -> 606485k
    Leak: 55582k -> 55639k
    Overhead: 67698k -> 68469k
    GGC runs: 524 -> 517

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Amount of produced GGC garbage increased from 681532k to 682424k, overall 0.13%
  Amount of memory still referenced at the end of compilation increased from 56199k to 56732k, overall 0.95%
    Overall memory needed: 105544k -> 105616k
    Peak memory use before GGC: 94274k
    Peak memory use after GGC: 93339k
    Maximum of released memory in single GGC run: 19336k
    Garbage: 681532k -> 682424k
    Leak: 56199k -> 56732k
    Overhead: 78768k -> 79191k
    GGC runs: 587 -> 570

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Amount of produced GGC garbage increased from 727608k to 740852k, overall 1.82%
  Amount of memory still referenced at the end of compilation increased from 56743k to 57726k, overall 1.73%
    Overall memory needed: 108356k -> 109420k
    Peak memory use before GGC: 95464k
    Peak memory use after GGC: 94518k
    Maximum of released memory in single GGC run: 19608k
    Garbage: 727608k -> 740852k
    Leak: 56743k -> 57726k
    Overhead: 82371k -> 83860k
    GGC runs: 596 -> 582

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2005-07-28 12:59:47.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2005-07-30 08:22:31.000000000 +0000
@@ -1,3 +1,286 @@
+2005-07-29  Wolfgang Bangerth <bangerth@dealii.org>
+ 
+	PR target/22582
+	* doc/invoke.texi: Document -rdynamic.
+ 
+2005-07-30  Joseph S. Myers  <joseph@codesourcery.com>
+
+	PR c/23143
+	* c-parser.c (c_parser_parms_list_declarator): Call
+	mark_forward_parm_decls.
+	* c-decl.c (merge_decls): Only check DECL_IN_SYSTEM_HEADER for
+	decls with visibility structure.
+
+2005-07-30  Paul Brook  <paul@codesourcery.com>
+
+	* config/arm/arm.c (arm_coproc_mem_operand): Fix inaccurate comment.
+
+2005-07-30  Paul Brook  <paul@codesourcery.com>
+
+	* config/arm/arm-protos.h (arm_canonicalize_comparison): Update
+	prototype.
+	* config/arm/arm.c (arm_canonicalize_comparison): Use correct limit
+	value for mode.
+	* config/arm/arm.h (CANONICALIZE_COMPARISON): Pass mode argument.
+
+2005-07-29  Joseph S. Myers  <joseph@codesourcery.com>
+
+	PR c/529
+	* c-decl.c (warn_if_shadowing): Don't check for PARM_DECL in
+	nested function declarators.
+	(pushdecl): Don't call warn_if_shadowing for PARM_DECL.
+	(grokparms): Call warn_if_shadowing for parameters used within the
+	parameter list.
+	(store_parm_decls_newstyle): Call warn_if_shadowing for parameters
+	not used within the parameter list.
+	(store_parm_decls_oldstyle): Call warn_if_shadowing for parameters.
+
+2005-07-30  Jan Hubicka  <jh@suse.cz>
+
+	* expr.c (expand_expr_real_1): Do not load mem targets into register.
+	* i386.c (ix86_fixup_binary_operands): Likewise.
+	(ix86_expand_unary_operator): Likewise.
+	(ix86_expand_fp_absneg_operator): Likewise.
+	* optabs.c (expand_vec_cond_expr): Validate dest.
+
+2005-07-29  Joseph S. Myers  <joseph@codesourcery.com>
+
+	PR c/21720
+	* real.c (real_from_string): Also set last bit if there is a
+	nonzero hex digit beyond GCC's internal precision after ".".
+
+2005-07-29  David Edelsohn  <edelsohn@gnu.org>
+
+	* config/rs6000/altivec.md: Convert UNSPEC numerical values to
+	define_constants.  Change duplicate values to unassigned numbers.
+	Change UNSPEC_SUBS to UNSPEC_VSUBS.
+	(*altivec_vspltsf): New.
+	(altivec_vperm_v4sf): Delete.
+	(altivec_vperm_<mode>): Use mode macro V.
+	(altivec_vsldoi_<mode>): Convert to mode macro pattern.
+	(altivec_predicate_v4sf): Delete.
+	(altivec_predicate_<mode>): Use mode macro V.
+	(*altivec_lvesfx): New.
+	(*altivec_stvesfx): New.
+	(vec_realign_load_v4sf): Delete.
+	(vec_realign_load_<mode>): Use mode macro V.
+	* config/rs6000/rs6000.c (generate_set_vrsave): Use
+	UNSPECV_SET_VRSAVE.
+
+2005-07-29  Mark Mitchell  <mark@codesourcery.com>
+
+	PR bootstrap/23131
+	* configure.ac (SYSTEM_HEADER_DIR): Avoid setting to empty
+	string. 
+	* configure: Regenerated.
+
+2005-07-29  Paul Brook  <paul@codesourcery.com>
+
+	* doc/install.texi: Add link to GFortran binaries wiki page.
+
+2005-07-29  David Ung  <davidu@mips.com>
+
+	* config/mips/mips.c (mips_cpu_info_table): Add 5kf to the table.
+	(mips_rtx_cost_data): Add costs for 5kc and 5kf.
+	* config/mips/mips.h (processor_type): Add PROCESSOR_5KF.
+	* config/mips/mips.md (cpu): Add 5kf name.
+	(includes): Includes 5k.md.
+	* config/mips/5k.md: New DFA pipeline for the 5kc/5kf.
+	* doc/invoke.texi (MIPS Options): Updated cpu name supported with
+	-march flag.	
+
+2005-07-29  Diego Novillo  <dnovillo@redhat.com>
+
+	PR 22550
+	* tree-cfgcleanup.c (cleanup_tree_cfg_1): Extract from ...
+	(cleanup_tree_cfg): ... here.
+	Call cleanup_tree_cfg_1 until there are no more cleanups to
+	do.
+
+2005-07-29  James A. Morrison  <phython@gcc.gnu.org>
+
+	* tree-vrp.c (compare_range_with_value): Return true or false
+	for ~[VAL_1, VAL_2] OP VAL if VAL_1 <= VAL <= VAL_2 for NE_EXPR and
+	EQ_EXPR respectively.
+
+2005-07-29  Kazu Hirata  <kazu@codesourcery.com>
+
+	* cfg.c, tree-complex.c, config/frv/frv.c, config/i386/i386.c:
+	Fix comment typos.
+
+2005-07-29  Diego Novillo  <dnovillo@redhat.com>
+
+	* tree-ssa-dom.c (struct opt_stats_d): Add field num_iterations.
+	(tree_ssa_dominator_optimize): Increment it.
+	(dump_dominator_optimization_stats): Print it.
+
+2005-07-29  Richard Earnshaw  <richard.earnshaw@arm.com>
+	    Steven Bosscher  <stevenb@suse.de>
+
+	PR rtl-optimization/23117
+	* sched-rgn.c (add_branch_dependences): Handle COND_EXEC correctly
+	when head == tail.  Tidy comment.
+
+2005-07-28  Richard Henderson  <rth@redhat.com>
+
+	* cse.c (exp_equiv_p): Special case CONST_DOUBLE.
+	* cselib.c (rtx_equal_for_cselib_p): Likewise.
+	* jump.c (rtx_renumbered_equal_p): Likewise.
+	* loop.c (rtx_equal_for_loop_p): Tidy and special case PC, CC0,
+	CONST_INT and CONST_DOUBLE.
+	(rtx_equal_for_prefetch_p): Likewise, plus LABEL_REF.
+	* reload.c (operands_match_p): Special case CONST_INT and
+	CONST_DOUBLE; check mode earlier.
+
+2005-07-29  Joseph S. Myers  <joseph@codesourcery.com>
+
+	PR c/22240
+	* c-typeck.c (convert_for_assignment): Do not check
+	DECL_IN_SYSTEM_HEADER on NULL fundecl.
+
+2005-07-29  Joseph S. Myers  <joseph@codesourcery.com>
+
+	PR c/22192
+	* c-typeck.c (composite_type): Prefer constant size arrays to
+	VLAs.
+
+2005-07-29  Joseph S. Myers  <joseph@codesourcery.com>
+
+	PR c/21720
+	* real.c (real_from_string): Set last bit if there is a nonzero
+	hex digit beyond GCC's internal precision.
+
+2005-07-28  Richard Henderson  <rth@redhat.com>
+
+	PR rtl-opt/22619
+	* cfgcleanup.c (try_forward_edges): Watch out for end of
+	insn chain.
+
+2005-07-28  James E Wilson  <wilson@specifixinc.com>
+
+	PR c/23106
+	* doc/invoke.texi (Wstrict-aliasing=2): Fix misleading wording.
+
+2005-07-28  Jan Hubicka  <jh@suse.cz>
+
+	* Makefile.in (rtl-profile.o): Kill all traces of it.
+	* common.opt (fspeculative-prefetching, ftree-based-profiling): Kill.
+	* coverage.h (rtl_coverage_counter_ref): Kill.
+	* opts.c (flag_speculative_prefetching_set): Kill.
+	(flag_loop_optimize_set): New.
+	(common_handle_option): Disable loop optimizer when profiling;
+	do not handle speculative prefetching.
+	* passes.c (init_optimization_passes): Replace pass_profiling combo
+	by branch_prob pass.
+	* profile.c (compute_value_histograms): Update for simplified value
+	profiles.
+	(rtl_register_profile_hooks): Kill.
+	(pass_profiling): Kill.
+	(rest_of_handle_branch_prob): Do not profile.
+	* toplev.c (process_options): Remove speculative prefetching.
+	* toplev.h (flag_tree_based_profiling): Kill.
+	* tree-profile.c (prepare_instrumented_value,
+	tree_gen_interval_profiler, tree_gen_pow2_profiler,
+	tree_gen_one_value_profiler, do_tree_profiling): Update for
+	simplified datastructures.
+	* value-prof.c: Add comment that speculative prefetching was dropped;
+	update rest of file for simplified datastructures.
+	(NOPREFETCH_RANGE_MIN, NOPREFETCH_RANGE_MAX,
+	rtl_divmod_values_to_profile, insn_prefetch_values_to_profile,
+	find_mem_reference_1, find_mem_reference_2, find_mem_reference,
+	rtl_values_to_profile, rtl_divmod_fixed_value, rtl_mod_pow2,
+	rtl_mod_subtract, gen_speculative_prefetch,
+	rtl_divmod_fixed_value_transform, rtl_mod_pow2_value_transform,
+	rtl_mod_subtract_transform, speculative_prefetching_transform): Kill.
+	(gate_handle_value_profile_transformations,
+	rest_of_handle_value_profile_transformations,
+	pass_value_profile_transformations): Kill.
+	* value-prof.h (histogram_value_t): Remove IL based unions.
+	(rtl_register_value_prof_hooks, rtl_register_profile_hooks,
+	rtl_profile_hooks): Remove hooks.
+
+	* invoke.texi (-ftree-based-profiling, -fspeculative-prefetching): Kill.
+
+	* cgraph.c (cgraph_clone_edge): New UPDATE_ORIGINAL argument.
+	(cgraph_clone_node): Likewise.
+	* cgraph.h (cgraph_clone_edge): Update prototype.
+	(cgraph_clone_node): Likewise.
+	* ipa-inline.c (cgraph_clone_inlined_nodes): Update call of
+	cgraph_clone_node.
+	(lookup_recursive_calls): Consider profile.
+	(cgraph_decide_recursive_inlining): Fix updating; use new
+	probability argument; use profile.
+	* params.def (PARAM_MIN_INLINE_RECURSIVE_PROBABILITY): New.
+	* tree-inline.c (copy_bb): Update clal of clone_edge.
+	* tree-optimize.c (tree_rest_of_compilation): UPdate cal of clone_node.
+
+	* invoke.texi (min-inline-recursive-probability): Document.
+
+2005-07-28  Gerald Pfeifer  <gerald@pfeifer.com>
+
+	* doc/install.texi (Configuration): Update Valgrind homepage.
+
+2005-07-28  Richard Henderson  <rth@redhat.com>
+
+	PR middle-end/21362
+	* cfgrtl.c (rtl_merge_blocks): Call maybe_remove_eh_handler on
+	labels we want to delete.
+	(cfg_layout_merge_blocks): Likewise.
+
+2005-07-28  Richard Henderson  <rth@redhat.com>
+
+	PR target/17692
+        * config/i386/i386.c (ix86_split_sse_movcc): Emit DELETED note
+        when expanding to nothing.
+
+2005-07-28  Josh Conner  <jconner@apple.com>
+
+	* ipa-inline.c (update_caller_keys): Fix estimated_growth caching.
+	(cgraph_decide_inlining_of_small_functions): Likewise.
+
+2005-07-28  Josh Conner  <jconner@apple.com>
+
+	* ipa-inline.c (cgraph_edge_badness): Update comments.  Invert shift
+	direction of badness if negative.
+	(cgraph_default_inline_p): Add reason to parameters, and assign it
+	a value.
+	(cgraph_decide_inlining_of_small_functions): New parameter in call
+	to cgraph_default_inline_p.
+	(cgraph_decide_inlining_incrementally): Likewise.
+	* cgraphunit.c (decide_is_function_needed): Likewise.
+	* cgraph.h (cgraph_default_inline_p): Likewise.
+
+2005-07-28  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+	* builtins.c: Fix comment typo(s).
+	* genautomata.c: Likewise.
+	* gimplify.c: Likewise.
+	* tree-dfa.c: Likewise.
+	* tree-flow-inline.h: Likewise.
+	* tree-into-ssa.c: Likewise.
+	* tree-ssa-alias.c: Likewise.
+	* tree-ssa-ccp.c: Likewise.
+	* tree-ssa-copy.c: Likewise.
+	* tree-ssa-dce.c: Likewise.
+	* tree-ssa-dom.c: Likewise.
+	* tree-ssa-operands.c: Likewise.
+	* tree-tailcall.c: Likewise.
+	* tree-vectorizer.c: Likewise.
+	* tree-vrp.c: Likewise.
+	* tree.c: Likewise.
+
+2005-07-28  Jeff Law  <law@redhat.com>
+
+        * tree-vrp.c (test_for_singularity): Extracted from  ...
+        (simplify_cond_using_ranges): Attempt to simplify a relational
+        test to NE_EXPR.  Dump information when a COND_EXPR is simplified.
+
+2005-07-28  Dorit Nuzman  <dorit@il.ibm.com>
+
+	PR tree-optimization/22506
+	* tree-vectorizer.c (update_phi_nodes_for_guard2): Skip loop-closed
+	phis whose argument is constant.
+
 2005-07-28  J"orn Rennecke <joern.rennecke@st.com>
 
 	PR rtl-optimization/18992
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2005-07-27 20:23:40.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2005-07-30 08:22:55.000000000 +0000
@@ -1,3 +1,19 @@
+2005-07-29  Kazu Hirata  <kazu@codesourcery.com>
+
+	* method.c: Fix a comment typo.
+
+2005-07-28  Mark Mitchell  <mark@codesourcery.com>
+
+	PR c++/22545
+	* call.c (add_builtin_candidate): Adjust for changes in
+	representation of pointer-to-member types.
+
+2005-07-28  Mike Stump  <mrs@apple.com>
+
+	* pt.c (check_explicit_specialization): Add visibility logic.
+	(lookup_template_class): Likewise.
+	(instantiate_class_template): Likewise.
+
 2005-07-27  Devang Patel  <dpatel@apple.com>
 
 	* name-lookup.c (pushtag): Do no set DECL_IGNORED_P bit.


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]