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:
  Peak amount of GGC memory allocated before garbage collecting increased from 9282k to 9293k, overall 0.12%
  Peak amount of GGC memory still allocated after garbage collectin increased from 8821k to 8832k, overall 0.12%
    Overall memory needed: 28347k -> 28371k
    Peak memory use before GGC: 9282k -> 9293k
    Peak memory use after GGC: 8821k -> 8832k
    Maximum of released memory in single GGC run: 2666k
    Garbage: 36829k -> 36856k
    Leak: 6441k -> 6441k
    Overhead: 4856k -> 4860k
    GGC runs: 280

comparing combine.c compilation at -O1 level:
  Amount of memory still referenced at the end of compilation increased from 6482k to 6505k, overall 0.36%
    Overall memory needed: 40195k -> 40211k
    Peak memory use before GGC: 17270k -> 17281k
    Peak memory use after GGC: 17094k -> 17106k
    Maximum of released memory in single GGC run: 2383k -> 2382k
    Garbage: 57448k -> 57445k
    Leak: 6482k -> 6505k
    Overhead: 6196k -> 6200k
    GGC runs: 355

comparing combine.c compilation at -O2 level:
  Amount of memory still referenced at the end of compilation increased from 6578k to 6593k, overall 0.23%
    Overall memory needed: 29778k -> 29790k
    Peak memory use before GGC: 17266k -> 17277k
    Peak memory use after GGC: 17094k -> 17106k
    Maximum of released memory in single GGC run: 2900k -> 2883k
    Garbage: 76340k -> 76254k
    Leak: 6578k -> 6593k
    Overhead: 8741k -> 8744k
    GGC runs: 420

comparing combine.c compilation at -O3 level:
  Amount of memory still referenced at the end of compilation increased from 6653k to 6668k, overall 0.23%
    Overall memory needed: 28882k -> 28894k
    Peak memory use before GGC: 18206k -> 18217k
    Peak memory use after GGC: 17822k -> 17833k
    Maximum of released memory in single GGC run: 4105k -> 4104k
    Garbage: 106171k -> 106198k
    Leak: 6653k -> 6668k
    Overhead: 12295k -> 12303k
    GGC runs: 469

comparing insn-attrtab.c compilation at -O0 level:
  Amount of memory still referenced at the end of compilation increased from 9486k to 9501k, overall 0.16%
    Overall memory needed: 88222k -> 88230k
    Peak memory use before GGC: 69766k -> 69777k
    Peak memory use after GGC: 44176k -> 44187k
    Maximum of released memory in single GGC run: 36964k -> 36963k
    Garbage: 129071k -> 129065k
    Leak: 9486k -> 9501k
    Overhead: 16989k -> 16993k
    GGC runs: 217 -> 216

comparing insn-attrtab.c compilation at -O1 level:
  Amount of memory still referenced at the end of compilation increased from 9328k to 9343k, overall 0.16%
    Overall memory needed: 114150k -> 114174k
    Peak memory use before GGC: 90352k -> 90363k
    Peak memory use after GGC: 83714k -> 83725k
    Maximum of released memory in single GGC run: 31806k
    Garbage: 277742k -> 277740k
    Leak: 9328k -> 9343k
    Overhead: 29771k -> 29775k
    GGC runs: 223

comparing insn-attrtab.c compilation at -O2 level:
  Overall memory allocated via mmap and sbrk increased from 120258k to 134058k, overall 11.48%
  Amount of memory still referenced at the end of compilation increased from 9330k to 9345k, overall 0.16%
    Overall memory needed: 120258k -> 134058k
    Peak memory use before GGC: 92581k -> 92593k
    Peak memory use after GGC: 84694k -> 84705k
    Maximum of released memory in single GGC run: 30380k
    Garbage: 319046k -> 319045k
    Leak: 9330k -> 9345k
    Overhead: 36713k -> 36716k
    GGC runs: 247

comparing insn-attrtab.c compilation at -O3 level:
  Ovarall memory allocated via mmap and sbrk decreased from 129334k to 115574k, overall -11.91%
  Amount of memory still referenced at the end of compilation increased from 9333k to 9348k, overall 0.16%
    Overall memory needed: 129334k -> 115574k
    Peak memory use before GGC: 92607k -> 92618k
    Peak memory use after GGC: 84719k -> 84731k
    Maximum of released memory in single GGC run: 30571k -> 30570k
    Garbage: 319694k -> 319697k
    Leak: 9333k -> 9348k
    Overhead: 36910k -> 36914k
    GGC runs: 250

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 119490k -> 119502k
    Peak memory use before GGC: 92635k -> 92646k
    Peak memory use after GGC: 91717k -> 91729k
    Maximum of released memory in single GGC run: 19299k
    Garbage: 205556k -> 205559k
    Leak: 47662k -> 47677k
    Overhead: 20811k -> 20816k
    GGC runs: 402

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 119222k -> 119242k
    Peak memory use before GGC: 97821k -> 97832k
    Peak memory use after GGC: 95611k -> 95623k
    Maximum of released memory in single GGC run: 18569k
    Garbage: 444259k -> 444257k
    Leak: 49995k -> 50010k
    Overhead: 32811k -> 32813k
    GGC runs: 552

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 119218k -> 119250k
    Peak memory use before GGC: 97820k -> 97832k
    Peak memory use after GGC: 95611k -> 95622k
    Maximum of released memory in single GGC run: 18569k -> 18570k
    Garbage: 505995k -> 505913k
    Leak: 50700k -> 50715k
    Overhead: 40452k -> 40462k
    GGC runs: 609 -> 610

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 118922k -> 118938k
    Peak memory use before GGC: 97868k -> 97879k
    Peak memory use after GGC: 96898k -> 96909k
    Maximum of released memory in single GGC run: 18831k -> 18832k
    Garbage: 525377k -> 525475k
    Leak: 50275k -> 50292k
    Overhead: 40968k -> 40990k
    GGC runs: 623 -> 624

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
  Amount of memory still referenced at the end of compilation increased from 7507k to 7522k, overall 0.20%
    Overall memory needed: 137934k -> 137946k
    Peak memory use before GGC: 81886k -> 81898k
    Peak memory use after GGC: 58766k -> 58777k
    Maximum of released memory in single GGC run: 45494k -> 45493k
    Garbage: 147250k -> 147195k
    Leak: 7507k -> 7522k
    Overhead: 25296k -> 25300k
    GGC runs: 83

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 424294k -> 424402k
    Peak memory use before GGC: 205249k -> 205260k
    Peak memory use after GGC: 201025k -> 201036k
    Maximum of released memory in single GGC run: 101716k
    Garbage: 271709k -> 271708k
    Leak: 47573k -> 47588k
    Overhead: 30825k -> 30829k
    GGC runs: 101

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 352134k -> 351290k
    Peak memory use before GGC: 206000k -> 206011k
    Peak memory use after GGC: 201776k -> 201787k
    Maximum of released memory in single GGC run: 108041k -> 108042k
    Garbage: 350431k -> 350433k
    Leak: 48156k -> 48171k
    Overhead: 46270k -> 46275k
    GGC runs: 108

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 535278k -> 535282k
    Peak memory use before GGC: 314907k -> 314918k
    Peak memory use after GGC: 293250k -> 293261k
    Maximum of released memory in single GGC run: 163448k
    Garbage: 491202k -> 491202k
    Leak: 65488k -> 65503k
    Overhead: 59087k -> 59091k
    GGC runs: 95

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-11-01 00:39:47.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-11-01 12:06:22.000000000 +0000
@@ -1,3 +1,168 @@
+2006-11-01  Richard Guenther  <rguenther@suse.de>
+
+	* config/i386/i386.c (ix86_expand_rint): Fix issues with
+	signed zeros.
+	(ix86_expand_floorceildf_32): Likewise.
+	(ix86_expand_floorceil): Likewise.
+	(ix86_expand_trunc): Likewise.
+
+2006-10-31  Andrew Pinski  <pinskia@gmail.com>
+
+	* doc/invoke.texi (-fkeep-inline-functions): Change "GNU C"
+	to "GNU C89".
+
+2006-11-01  Danny Smith  <dannysmith@users.sourceforge.net>
+
+	* target.h (targetm.cxx.use_atexit_for_cxa_atexit): New target
+	hook.
+	* target-def.h: (TARGET_CXX_USE_ATEXIT_FOR_CXA_ATEXIT): Define
+	default.
+	* config/i386/mingw32.h (TARGET_CXX_USE_ATEXIT_FOR_CXA_ATEXIT):
+	Override default.
+	* doc/tm.texi (TARGET_CXX_USE_ATEXIT_FOR_CXA_ATEXIT): Document.
+	* configure.ac (use_cxa_atexit): As a special case, don't test
+	for libc definition of __cxa_atexit on mingw32
+	* configure: Regenerate.
+	* config.gcc (i[34567]86-pc-mingw32): Default to
+	enable__cxa_atexit=yes.
+
+2006-11-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+	* builtins.def (gamma, lgamma): Use ATTR_MATHFN_FPROUNDING_STORE.
+
+2006-10-31  Geoffrey Keating  <geoffk@apple.com>
+
+	PR 23067
+	* c-decl.c (start_struct): Don't create self-containing
+	structures.
+	* config/rs6000/rs6000.c (darwin_rs6000_special_round_type_align):
+	New.
+	* config/rs6000/rs6000-protos.h
+	(darwin_rs6000_special_round_type_align): New.
+	* config/rs6000/darwin.h (ADJUST_FIELD_ALIGN): Rewrite.
+	(ROUND_TYPE_ALIGN): Use darwin_rs6000_special_round_type_align.
+
+2006-10-31  Geoffrey Keating  <geoffk@apple.com>
+
+	* toplev.c (compile_file): Call final_write_globals
+	even if there have been errors.
+	
+2006-10-31  Eric Christopher  <echristo@apple.com>
+	    Falk Hueffner  <falk@debian.org>
+
+	* doc/extend.texi (__builtin_bswap32): Document.
+	(__builtin_bswap64): Ditto.
+	* doc/libgcc.texi (bswapsi2): Document.
+	(bswapdi2): Ditto.
+	* doc/rtl.texi (bswap): Document.
+	* optabs.c (expand_unop): Don't widen a bswap.
+	(init_optabs): Init bswap. Set libfuncs explicitly
+	for bswapsi2 and bswapdi2.
+	* optabs.h (OTI_bswap): New.
+	(bswap_optab): Ditto.
+	* genopinit.c (optabs): Handle bswap_optab.
+	* tree.h (tree_index): Add TI_UINT32_TYPE and
+	TI_UINT64_TYPE.
+	(uint32_type_node): New.
+	(uint64_type_node): Ditto.
+	* tree.c (build_common_tree_nodes_2): Initialize
+	uint32_type_node and uint64_type_node.
+	* builtins.c (expand_builtin_bswap): New.
+	(expand_builtin): Call.
+	(fold_builtin_bswap): New.
+	(fold_builtin_1): Call.
+	* fold-const.c (tree_expr_nonnegative_p): Return true
+	for bswap.
+	* builtin-types.def (BT_UINT32): New.
+	(BT_UINT64): Ditto.
+	(BT_FN_UINT32_UINT32): Ditto.
+	(BT_FN_UINT64_UINT64): Ditto.
+	* builtins.def (BUILT_IN_BSWAP32): New.
+	(BUILT_IN_BSWAP64): Ditto.
+	* rtl.def (BSWAP): New.
+	* genattrtab.c (check_attr_value): New.
+	* libgcc2.c (__bswapSI2): New.
+	(__bswapDI2): Ditto.
+	* libgcc2.h (__bswapSI2): Declare.
+	(__bswapDI2): Ditto.
+	* mklibgcc.in (lib2funcs): Add _bswapsi2 and _bswapdi2.
+	* simplify-rtx.c (simplify_const_unary_operation): Return
+	0 for BSWAP.
+	* libgcc-std.ver (__bwapsi2): Add.
+	(__bswapdi2): Ditto.
+	* reload1.c (eliminate_regs_1): Add bswap.
+	(elimination_effects): Ditto.
+	* config/i386/i386.h (x86_bswap): New.
+	(TARGET_BSWAP): Use.
+	* config/i386/i386.c (x86_bswap): Set.
+
+2006-10-31  Geoffrey Keating  <geoffk@apple.com>
+
+	* coverage.c (coverage_checksum_string): Update comment.
+	* dwarf2out.c (switch_to_eh_frame_section): Update for removal
+	of get_file_function_name.
+	* cgraphunit.c (cgraph_build_static_cdtor): Update for rename
+	of get_file_function_name_long.
+	* tree.c (get_file_function_name): Rename from
+	get_file_function_name_long; improve comment; handle 'I' and 'D'
+	specially when the target has ctor/dtor support; remove special
+	handling for 'F'.
+	(get_file_function_name): Remove.
+	* tree.h (get_file_function_name): Rename from
+        get_file_function_name_long.
+	(get_file_function_name): Remove prototype.
+
+2006-10-31  Geoffrey Keating  <geoffk@apple.com>
+
+	* config/i386/darwin.h (PREFERRED_DEBUGGING_TYPE): Remove.
+	* config/darwin.h (PREFERRED_DEBUGGING_TYPE): Set to DWARF2_DEBUG.
+
+	* config/darwin.h (LINK_COMMAND_SPEC): Don't do weird things with -@.
+	Call dsymutil when compiling and linking one or more source files
+	in one step.
+
+2006-10-31  Geoffrey Keating  <geoffk@apple.com>
+
+	PR 15834
+	* config/darwin.h (NO_IMPLICIT_EXTERN_C): Define.
+
+2006-10-31  Geoffrey Keating  <geoffk@apple.com>
+
+	* c-decl.c (grokdeclarator): Don't set DECL_EXTERNAL on
+	inline static functions in c99 mode.
+
+	PR 16622
+	* doc/extend.texi (Inline): Update.
+	* c-tree.h (struct language_function): Remove field 'extern_inline'.
+	* c-decl.c (current_extern_inline): Delete.
+	(pop_scope): Adjust test for an undefined nested function.
+	Add warning about undeclared inline function.
+	(diagnose_mismatched_decls): Update comments.  Disallow overriding
+	of inline functions in a translation unit in C99.  Allow inline
+	declarations in C99 at any time.
+	(merge_decls): Boolize variables.  Handle C99 'extern inline'
+	semantics.
+	(grokdeclarator): Set DECL_EXTERNAL here for functions.  Handle
+	C99 inline semantics.
+	(start_function): Don't clear current_extern_inline.  Don't set
+	DECL_EXTERNAL.
+	(c_push_function_context): Don't push current_extern_inline.
+	(c_pop_function_context): Don't restore current_extern_inline.
+
+	PR 11377
+	* c-typeck.c (build_external_ref): Warn about static variables
+	used in extern inline functions.
+	* c-decl.c (start_decl): Warn about static variables declared
+	in extern inline functions.
+
+2006-10-31  Roger Sayle  <roger@eyesopen.com>
+
+	PR middle-end/23470
+	* tree.h (tree_expr_nonnegative_p): Return "bool" instead of "int".
+	* fold-const.c (tree_expr_nonnegative_p): Likewise.  Consider
+	pow(x,y) and powi(x,y) to be nonnegative if either x is nonnegative
+	or y is an even integer.
+
 2006-10-31  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
 	PR target/24071
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2006-10-31 01:47:05.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2006-11-01 12:06:02.000000000 +0000
@@ -1,3 +1,27 @@
+2006-11-01  Danny Smith  <dannysmith@users.sourceforge.net>
+
+	* decl.c (get_atexit_node): Reference atexit, not __cxa_exit.
+	if targetm.cxx.use_atexit_for cxa_atexit.
+	(start_cleanup_fn): Likewise.
+	(register_dtor_fn): Likewise.
+
+2006-09-25  Geoffrey Keating  <geoffk@apple.com>
+
+	* decl2.c (cp_write_global_declarations): Rename from
+	cp_finish_file.
+	* cp-lang.c (finish_file): Don't call cp_finish_file.
+	* cp-tree.h (cp_write_global_declarations): Rename from
+	cp_finish_file.
+	* cp-objcp-common.h (LANG_HOOKS_WRITE_GLOBALS): Define to
+	cp_write_global_declarations.
+
+2006-10-31  Geoffrey Keating  <geoffk@apple.com>
+
+	* name-lookup.c (get_anonymous_namespace_name): New.
+	(push_namespace_with_attribs): Use get_anonymous_namespace_name.
+	* decl2.c (start_objects): Update for rename of
+	get_file_function_name_long.
+
 2006-10-30  Dirk Mueller  <dmueller@suse.de>
 
 	PR c++/28704


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]