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!


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: 18337k
    Peak memory use before GGC: 2263k
    Peak memory use after GGC: 1954k
    Maximum of released memory in single GGC run: 309k
    Garbage: 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
    Leak: 2320k
    Overhead: 460k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 18449k -> 18445k
    Peak memory use before GGC: 2263k
    Peak memory use after GGC: 1954k
    Maximum of released memory in single GGC run: 309k
    Garbage: 450k
    Leak: 2290k
    Overhead: 456k
    GGC runs: 4

comparing empty function compilation at -O2 level:
    Overall memory needed: 18461k -> 18457k
    Peak memory use before GGC: 2264k
    Peak memory use after GGC: 1954k
    Maximum of released memory in single GGC run: 310k
    Garbage: 453k
    Leak: 2290k
    Overhead: 456k
    GGC runs: 4

comparing empty function compilation at -O3 level:
    Overall memory needed: 18461k -> 18457k
    Peak memory use before GGC: 2264k
    Peak memory use after GGC: 1954k
    Maximum of released memory in single GGC run: 310k
    Garbage: 453k
    Leak: 2290k
    Overhead: 456k
    GGC runs: 4

comparing combine.c compilation at -O0 level:
    Overall memory needed: 28617k
    Peak memory use before GGC: 9311k
    Peak memory use after GGC: 8864k
    Maximum of released memory in single GGC run: 2605k
    Garbage: 37287k
    Leak: 6538k
    Overhead: 4829k
    GGC runs: 277

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 30669k
    Peak memory use before GGC: 10894k
    Peak memory use after GGC: 10523k
    Maximum of released memory in single GGC run: 2365k
    Garbage: 37869k
    Leak: 9414k
    Overhead: 5530k
    GGC runs: 271

comparing combine.c compilation at -O1 level:
    Overall memory needed: 33538k
    Peak memory use before GGC: 20881k
    Peak memory use after GGC: 20647k
    Maximum of released memory in single GGC run: 2262k
    Garbage: 55411k -> 55422k
    Leak: 6565k
    Overhead: 9964k -> 9964k
    GGC runs: 353

comparing combine.c compilation at -O2 level:
    Overall memory needed: 33538k
    Peak memory use before GGC: 20910k -> 20903k
    Peak memory use after GGC: 20700k -> 20693k
    Maximum of released memory in single GGC run: 2203k
    Garbage: 71363k -> 71306k
    Leak: 6695k
    Overhead: 11872k -> 11868k
    GGC runs: 406 -> 408

comparing combine.c compilation at -O3 level:
    Overall memory needed: 32766k
    Peak memory use before GGC: 21949k -> 21888k
    Peak memory use after GGC: 21344k -> 21283k
    Maximum of released memory in single GGC run: 3136k -> 3138k
    Garbage: 104469k -> 104250k
    Leak: 6768k
    Overhead: 16581k -> 16570k
    GGC runs: 463

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
    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
    Leak: 11268k
    Overhead: 17020k
    GGC runs: 209

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 100710k
    Peak memory use before GGC: 75640k
    Peak memory use after GGC: 71771k
    Maximum of released memory in single GGC run: 31283k
    Garbage: 229008k
    Leak: 9404k
    Overhead: 29491k
    GGC runs: 219

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 117058k -> 116074k
    Peak memory use before GGC: 83326k -> 82472k
    Peak memory use after GGC: 77491k -> 76636k
    Maximum of released memory in single GGC run: 29572k -> 29573k
    Garbage: 280830k -> 280468k
    Leak: 9401k
    Overhead: 35348k -> 35349k
    GGC runs: 241

comparing insn-attrtab.c compilation at -O3 level:
  Overall memory allocated via mmap and sbrk increased from 107446k to 116066k, overall 8.02%
    Overall memory needed: 107446k -> 116066k
    Peak memory use before GGC: 83367k -> 82512k
    Peak memory use after GGC: 77531k -> 76676k
    Maximum of released memory in single GGC run: 29748k
    Garbage: 281559k -> 281193k
    Leak: 9405k
    Overhead: 35562k -> 35563k
    GGC runs: 241

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: 208221k
    Leak: 49014k
    Overhead: 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: 214812k
    Leak: 72442k
    Overhead: 27105k
    GGC runs: 382

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 139602k
    Peak memory use before GGC: 112863k
    Peak memory use after GGC: 111746k
    Maximum of released memory in single GGC run: 17926k
    Garbage: 437281k -> 437334k
    Leak: 51041k -> 51043k
    Overhead: 99330k -> 99333k
    GGC runs: 586

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 139650k
    Peak memory use before GGC: 112891k -> 112892k
    Peak memory use after GGC: 111774k
    Maximum of released memory in single GGC run: 17926k
    Garbage: 491348k -> 491128k
    Leak: 52007k -> 52007k
    Overhead: 58590k -> 58653k
    GGC runs: 632

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 141518k
    Peak memory use before GGC: 114672k
    Peak memory use after GGC: 113482k
    Maximum of released memory in single GGC run: 18326k
    Garbage: 511828k -> 511741k
    Leak: 51976k -> 51978k
    Overhead: 58659k -> 58582k
    GGC runs: 644 -> 643

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 137302k -> 137646k
    Peak memory use before GGC: 81607k
    Peak memory use after GGC: 58486k
    Maximum of released memory in single GGC run: 44560k
    Garbage: 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: 148372k
    Leak: 9335k
    Overhead: 25561k
    GGC runs: 89

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 417830k
    Peak memory use before GGC: 200847k
    Peak memory use after GGC: 193545k
    Maximum of released memory in single GGC run: 112452k
    Garbage: 282084k
    Leak: 29804k
    Overhead: 32000k
    GGC runs: 91

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 341858k -> 342118k
    Peak memory use before GGC: 200842k -> 200841k
    Peak memory use after GGC: 193540k -> 193539k
    Maximum of released memory in single GGC run: 111878k -> 111877k
    Garbage: 359138k -> 359133k
    Leak: 30387k
    Overhead: 47155k -> 47154k
    GGC runs: 101

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 923410k -> 923246k
    Peak memory use before GGC: 317309k -> 317308k
    Peak memory use after GGC: 295751k
    Maximum of released memory in single GGC run: 168455k -> 168454k
    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-10 22:35:00.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-01-11 16:11:20.000000000 +0000
@@ -1,3 +1,113 @@
+2007-01-11  Roger Sayle  <roger@eyesopen.com>
+
+	* builtins.c (expand_builtin_pow, expand_builtin_powi,
+	fold_builtin_cabs, fold_builtin_sqrt, fold_builtin_trunc,
+	fold_builtin_floor, fold_builtin_ceil, fold_builtin_round,
+	fold_builtin_int_int_roundingfn, fold_builtin_bitop,
+	fold_builtin_bswap, real_constp, fold_builtin_pow,
+	fold_builtin_powi, fold_builtin_signbit, fold_builtin_copysign,
+	do_mpfr_arg1, do_mpfr_arg2, do_mpfr_arg3, do_mpfr_sincos): Replace
+	uses of the macro TREE_CONSTANT_OVERFLOW with TREE_OVERFLOW.
+	* convert.c (convert_to_pointer): Likewise.
+	* expr.c (highest_pow2_factor, expand_expr_real_1): Likewise.
+	* fold-const.c (force_fit_type, fold_negate_expr, int_const_binop,
+	const_binop, fold_convert_const_int_from_int,
+	fold_convert_const_int_from_real,
+	fold_convert_const_real_from_real, sign_bit_p,
+	optimize_minmax_comparison, extract_muldiv_1, fold_div_compare,
+	fold_sign_changed_comparison, fold_unary, fold_comparison,
+	fold_binary, multiple_of_p, tree_Expr_non_zero_p,
+	fold_negate_const, fold_abs_const, fold_not_const): Likewise.
+	* print-tree.c (print_node_brief, print_node): Likewise.
+	* stor-layout.c (place_field, layout_type): Likewise.
+	* tree-chrec.c (keep_cast): Likewise.
+	* tree.c (build_vector, build_real, build_real_from_int_cst,
+	build_complex): Likewise.
+
+2007-01-11  Roger Sayle  <roger@eyesopen.com>
+
+	* tree.h (TREE_CONSTANT_OVERFLOW): Obsolete.  For the time being,
+	treat TREE_CONSTANT_OVERFLOW as a synonym of TREE_OVERFLOW.
+
+2007-01-11  Paolo Bonzini  <bonzini@gnu.org>
+
+	* configure.ac (strict1_warn): Rename to strict_warn.
+	(WERROR, --enable-werror, symlink hacks, stage1_cflags,
+	cc_set_by_configure, quoted_cc_set_by_configure,
+	stage_prefix_set_by_configure, quoted_stage_prefix_set_by_configure,
+	all_boot_languages, all_stagestuff): Remove.
+	(target_list): Remove bootstrap targets.
+	* Makefile.in (quickstrap): Unconditionally make a synonym of all.
+	(BOOT_LANGUAGES, STAGE1_CFLAGS, STAGE1_CHECKING,
+	REMAKEFLAGS, FLAGS_TO_PASS, PREPEND_DOTDOT_TO_RELATIVE_PATHS,
+	SUBDIR_FLAGS_TO_PASS, WERROR_FLAGS, STRICT2_WARN, LANG_STAGESTUFF,
+	VOL_FILES, POSTSTAGE1_FLAGS_TO_PASS, STAGE2_FLAGS_TO_PASS,
+	STAGEPROFILE_FLAGS_TO_PASS, STAGEFEEDBACK_FLAGS_TO_PASS, stage1_build,
+	stage1_copy, stage2_build, stage2_copy, stageprofile_build,
+	stageprofile_copy, stage3_build, stage3_copy, stagefeedback_build,
+	stagefeedback_copy, stage4_build, clean_s1, clean_sw, bootstrap,
+	bootstrap-lean, bootstrap2, bootstrap2-lean, bootstrap3,
+	bootstrap3-lean, bootstrap4, bootstrap4-lean, unstage1, unstage2,
+	unstage3, unstage4, unstageprofile, unstagefeedback, restage, restage2,
+	restage3, restage4, restageprofile, restagefeedback, bubbleestrap,
+	cleanstrap, unstrap, restrap, *compare, *compare3, *compare4,
+	*compare-lean, *compare3-lean, *compare4-lean, stage1-start, stage1,
+	stage2-start, stage2, stage3-start, stage3, stage4-start, stage4,
+	stageprofile-start, stageprofile, stagefeedback-start, stagefeedback,
+	risky-stage1, risky-stage2, risky-stage3, risky-stage4): Remove.
+	(ORDINARY_FLAGS_TO_PASS): Rename to FLAGS_TO_PASS.
+	(STAGECOPYSTUFF, STAGEMOVESTUFF): Consolidate into MOSTLYCLEANFILES.
+	(mostlyclean): Adjust.
+	(clean, distclean): Don't mention bootstrap stuff.
+	* configure: Regenerate.
+	* ada/config-lang.in, cp/config-lang.in, forttran/config-lang.in,
+	java/config-lang.in, objc/config-lang.in, objcp/config-lang.in,
+	treelang/config-lang.in (stagestuff): Remove.
+	* doc/sourcebuild.texi (stage1, stage2, stage3, stage4,
+	stageprofile, stagefeedback, stagestuff): Remove mention.
+
+2007-01-11  Nick Clifton  <nickc@redhat.com>
+
+	* config/mcore/predicates.md (mcore_general_movesrc_operand):
+	Accept CONSTs.
+	(mcore_general_movdst_operand): Do not accept CONST_INTs.
+	(mcore_arith_K_S_operand): Run the test for the S constraint not
+	the test for the M constraint.
+	(mcore_addsub_operand): Do not accept integer values that are
+	larger than 32 bits.
+	* config/mcore/mcore.md: Remove unused constraints from split.
+	(andsi3): Use HOST_WIDE_INT instead of int to hold an INTVAL.
+	(addsi3): Likewise.
+	(allocate_stack): Likewise.
+	* config/mcore/mcore.c (mcore_print_operand): Restrict output of P
+	operands to 32 bits.
+	(mcore_const_costs): Use HOST_WIDE_INT instead of int to hold an
+	INTVAL.
+	(mcore_and_cost, mcore_modify_comparison, const_ok_for_mcore,
+	mcore_const_ok_for_inline, mcore_const_trick_uses_not,
+	try_constant_tricks, mcore_num_ones, mcore_num_zeros,
+	mcore_output_bclri, mcore_output_andn, output_inline_const,
+	mcore_output_move, mcore_output_movedouble): Likewise.
+	(mcore_output_cmov): Use CONST_OK_FOR_M and CONST_OK_FOR_N.
+	(output_inline_const): Likewise.
+	(output_inline_const): Fix format strings used in sprintf
+	statements.
+	* config/mcore/mcore-protos.h: Update prototypes for changed
+	functions in mcore.c.
+	* config/mcore/mcore.h (CONST_OK_FOR_I): Cast values to
+	HOST_WIDE_INT and not int.
+	(CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_L, CONST_OK_FOR_M,
+	CONST_OK_FOR_N): Likewise.
+	(LEGITIMATE_CONSTANT_P): Also check CONSTANT_P.
+	(GO_IF_LEGITIMATE_INDEX): Use HOST_WIDE_INT instead of int to hold
+	an INTVAL.
+
+2007-01-10  Jan Hubicka  <jh@suse.cz>
+
+	* tree-vrp.c (remove_range_assertions): Release defs.
+	* tree-ssa-loop-ivopts.c (rmeove_statement): Likewise.
+	* tree-ssa-dom.c (remove_stmt_or_phi): Likewise.
+
 2007-01-10  Paul Brook  <paul@codesourcery.com>
 
 	* config/arm/arm.c (arm_rtx_costs_1): Handle mutiply-subtract.
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2007-01-09 16:31:35.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2007-01-11 14:42:01.000000000 +0000
@@ -1,3 +1,11 @@
+2007-01-10  Mark Mitchell  <mark@codesourcery.com>
+
+	PR c++/28999
+	* decl.c (make_typename_type): If the qualified name is not a
+	type, issue an error.
+	* parser.c (cp_parser_elaborated_type_specifier): Fix comment
+	formatting.
+
 2007-01-08  Geoffrey Keating  <geoffk@apple.com>
 
 	* rtti.c: Include target.h.


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]