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 empty function compilation at -O0 level:
    Overall memory needed: 18247k
    Peak memory use before GGC: 2229k
    Peak memory use after GGC: 1936k
    Maximum of released memory in single GGC run: 293k
    Garbage: 422k
    Leak: 2266k
    Overhead: 445k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 18263k
    Peak memory use before GGC: 2256k
    Peak memory use after GGC: 1963k
    Maximum of released memory in single GGC run: 293k
    Garbage: 424k
    Leak: 2298k
    Overhead: 449k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 18347k
    Peak memory use before GGC: 2229k
    Peak memory use after GGC: 1936k
    Maximum of released memory in single GGC run: 293k
    Garbage: 427k
    Leak: 2269k
    Overhead: 445k
    GGC runs: 4

comparing empty function compilation at -O2 level:
    Overall memory needed: 18359k
    Peak memory use before GGC: 2229k
    Peak memory use after GGC: 1936k
    Maximum of released memory in single GGC run: 293k
    Garbage: 430k
    Leak: 2269k
    Overhead: 446k
    GGC runs: 4

comparing empty function compilation at -O3 level:
    Overall memory needed: 18359k
    Peak memory use before GGC: 2229k
    Peak memory use after GGC: 1936k
    Maximum of released memory in single GGC run: 293k
    Garbage: 430k
    Leak: 2269k
    Overhead: 446k
    GGC runs: 4

comparing combine.c compilation at -O0 level:
    Overall memory needed: 28431k
    Peak memory use before GGC: 9305k
    Peak memory use after GGC: 8844k
    Maximum of released memory in single GGC run: 2665k
    Garbage: 36852k
    Leak: 6456k
    Overhead: 4868k
    GGC runs: 280

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 30523k
    Peak memory use before GGC: 10855k
    Peak memory use after GGC: 10485k
    Maximum of released memory in single GGC run: 2415k
    Garbage: 37429k
    Leak: 9266k
    Overhead: 5536k
    GGC runs: 271

comparing combine.c compilation at -O1 level:
    Overall memory needed: 40271k
    Peak memory use before GGC: 17295k
    Peak memory use after GGC: 17120k
    Maximum of released memory in single GGC run: 2275k
    Garbage: 57480k
    Leak: 6510k
    Overhead: 6226k
    GGC runs: 357

comparing combine.c compilation at -O2 level:
    Overall memory needed: 29802k
    Peak memory use before GGC: 17291k
    Peak memory use after GGC: 17120k
    Maximum of released memory in single GGC run: 2869k
    Garbage: 74950k
    Leak: 6616k
    Overhead: 8484k
    GGC runs: 413

comparing combine.c compilation at -O3 level:
    Overall memory needed: 28902k
    Peak memory use before GGC: 18419k
    Peak memory use after GGC: 17847k
    Maximum of released memory in single GGC run: 4106k
    Garbage: 112706k
    Leak: 6684k
    Overhead: 13037k
    GGC runs: 463

    Overall memory needed: 28431k
    Peak memory use before GGC: 9305k
    Peak memory use after GGC: 8844k
    Maximum of released memory in single GGC run: 2665k
    Garbage: 36852k
    Leak: 6456k
    Overhead: 4868k
    GGC runs: 280

comparing combine.c compilation at -O1 level:
    Overall memory needed: 40271k
    Peak memory use before GGC: 17295k
    Peak memory use after GGC: 17120k
    Maximum of released memory in single GGC run: 2275k
    Garbage: 57480k
    Leak: 6510k
    Overhead: 6226k
    GGC runs: 357

comparing combine.c compilation at -O2 level:
    Overall memory needed: 29802k
    Peak memory use before GGC: 17291k
    Peak memory use after GGC: 17120k
    Maximum of released memory in single GGC run: 2869k
    Garbage: 74950k
    Leak: 6616k
    Overhead: 8484k
    GGC runs: 413

comparing combine.c compilation at -O3 level:
    Overall memory needed: 28902k
    Peak memory use before GGC: 18419k
    Peak memory use after GGC: 17847k
    Maximum of released memory in single GGC run: 4106k
    Garbage: 112706k
    Leak: 6684k
    Overhead: 13037k
    GGC runs: 463

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 88242k
    Peak memory use before GGC: 69789k
    Peak memory use after GGC: 44199k
    Maximum of released memory in single GGC run: 36964k
    Garbage: 129066k
    Leak: 9515k
    Overhead: 17000k
    GGC runs: 216

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 89422k
    Peak memory use before GGC: 70938k
    Peak memory use after GGC: 45455k
    Maximum of released memory in single GGC run: 36964k
    Garbage: 130494k
    Leak: 10946k
    Overhead: 17379k
    GGC runs: 212

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 112882k -> 112878k
    Peak memory use before GGC: 90375k
    Peak memory use after GGC: 83737k
    Maximum of released memory in single GGC run: 31852k
    Garbage: 277775k
    Leak: 9357k
    Overhead: 29791k
    GGC runs: 222

comparing insn-attrtab.c compilation at -O2 level:
  Ovarall memory allocated via mmap and sbrk decreased from 129382k to 124570k, overall -3.86%
    Overall memory needed: 129382k -> 124570k
    Peak memory use before GGC: 92604k
    Peak memory use after GGC: 84716k
    Maximum of released memory in single GGC run: 30395k
    Garbage: 317213k
    Leak: 9359k
    Overhead: 36375k
    GGC runs: 245

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 129418k
    Peak memory use before GGC: 92630k
    Peak memory use after GGC: 84742k
    Maximum of released memory in single GGC run: 30582k
    Garbage: 318075k
    Leak: 9362k
    Overhead: 36611k
    GGC runs: 249

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 119998k
    Peak memory use before GGC: 93308k
    Peak memory use after GGC: 92381k
    Maximum of released memory in single GGC run: 20013k
    Garbage: 207751k
    Leak: 47725k
    Overhead: 20983k
    GGC runs: 409

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 132498k
    Peak memory use before GGC: 105437k
    Peak memory use after GGC: 104386k
    Maximum of released memory in single GGC run: 19646k
    Garbage: 214333k
    Leak: 70684k
    Overhead: 26599k
    GGC runs: 380

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Amount of produced GGC garbage increased from 445830k to 446293k, overall 0.10%
  Amount of memory still referenced at the end of compilation increased from 50058k to 50111k, overall 0.11%
    Overall memory needed: 119134k
    Peak memory use before GGC: 97919k
    Peak memory use after GGC: 95707k
    Maximum of released memory in single GGC run: 18553k
    Garbage: 445830k -> 446293k
    Leak: 50058k -> 50111k
    Overhead: 32794k -> 32835k
    GGC runs: 559

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Amount of produced GGC garbage increased from 503933k to 505321k, overall 0.28%
  Amount of memory still referenced at the end of compilation increased from 50741k to 50795k, overall 0.11%
    Overall memory needed: 119158k
    Peak memory use before GGC: 97919k
    Peak memory use after GGC: 95706k
    Maximum of released memory in single GGC run: 18552k
    Garbage: 503933k -> 505321k
    Leak: 50741k -> 50795k
    Overhead: 39904k -> 40027k
    GGC runs: 613

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 118990k
    Peak memory use before GGC: 97964k
    Peak memory use after GGC: 96993k
    Maximum of released memory in single GGC run: 18932k
    Garbage: 526127k -> 526353k
    Leak: 50316k -> 50340k
    Overhead: 40898k -> 40933k
    GGC runs: 627 -> 628

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 137958k -> 137786k
    Peak memory use before GGC: 81909k
    Peak memory use after GGC: 58788k
    Maximum of released memory in single GGC run: 45493k
    Garbage: 147244k
    Leak: 7536k
    Overhead: 25303k
    GGC runs: 82

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 138134k
    Peak memory use before GGC: 82542k
    Peak memory use after GGC: 59422k
    Maximum of released memory in single GGC run: 45558k
    Garbage: 147415k
    Leak: 9244k
    Overhead: 25769k
    GGC runs: 88

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 424330k
    Peak memory use before GGC: 205229k
    Peak memory use after GGC: 201005k
    Maximum of released memory in single GGC run: 101903k
    Garbage: 272136k
    Leak: 47601k
    Overhead: 31281k
    GGC runs: 101

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 352406k -> 352082k
    Peak memory use before GGC: 206002k
    Peak memory use after GGC: 201778k
    Maximum of released memory in single GGC run: 108808k
    Garbage: 352361k
    Leak: 48184k
    Overhead: 47026k
    GGC runs: 110

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 781310k
    Peak memory use before GGC: 314925k
    Peak memory use after GGC: 293268k
    Maximum of released memory in single GGC run: 165331k
    Garbage: 494545k
    Leak: 65517k
    Overhead: 59917k
    GGC runs: 98

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-11-20 04:51:50.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-11-20 21:25:19.000000000 +0000
@@ -1,3 +1,72 @@
+2006-11-20  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+	PR tree-opt/25500
+	* tree-sra.c (single_scalar_field_in_record_p): New function.
+	(decide_block_copy): Use it.
+
+2006-11-20  David Daney  <ddaney@avtrex.com>
+
+	* config/mips/linux-unwind.h (mips_fallback_frame_state): Adjust
+	PC to point to following instruction.
+
+2006-11-20  Anatoly Sokolov <aesok@post.ru>
+
+	PR target/18553
+	PR target/29449
+	* config/avr/avr.h (OBJECT_FORMAT_ELF): Define.
+
+	* config/avr/avr.h (DWARF2_DEBUGGING_INFO): Define.
+
+2006-11-20  J"orn Rennecke  <joern.rennecke@st.com>
+
+	* config.gcc (sh*-superh-elf): Add t-superh to tmake_file.
+	Add sh/superh.h to tm_file.
+
+2006-11-20  Carlos O'Donell  <carlos@codesourcery.com>
+	    Mark Mitchell  <mark@codesourcery.com>
+
+	* cppdefault.c: Define cpp_PREFIX, cpp_PREFIX_len, and 
+	gcc_exec_prefix.
+	(cpp_relocated): New function.
+	* cppdefault.h: Declare cpp_PREFIX, cpp_PREFIX_len, gcc_exec_prefix 
+	and cpp_relocated. 
+	* Makefile.in (PREPROCESSOR_DEFINES): Add -DPREFIX option.
+	* c-incpath.c (add_standard_paths): Call cpp_relocated. If relocated,
+	replace configured prefix with gcc_exec_prefix. 
+
+2006-11-20  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+	* config/bfin/bfin.h (LEGITIMATE_CONSTANT_P): Call
+	bfin_legitimate_constant_p.
+	* config/bfin/bfin.md (movsi expander): Check return value of
+	expand_mvoe.
+	* config/bfin/bfin-protos.h (bfin_legitimate_constant_p): Declare.
+	(expand_move): Adjust prototype.
+	* config/bfin/bfin.c (expand_move): Now returns bool.  Handle
+	invalid constants specially.
+	(bfin_cannot_force_const_mem, bfin_legitimate_constant_p): New
+	functions.
+	(TARGET_CANNOT_FORCE_CONST_MEM): New macro.
+
+	* config/bfin/bfin.md (call_symbol, call_value_symbol, sibcall_symbol,
+	sibcall_value_symbol): Allow these patterns if
+	TARGET_LEAF_ID_SHARED_LIBRARY.
+	* config/bfin/bfin.c (bfin_expand_call): Allow them here as well.
+	(override_options): Turn on id shared library flags if -msep-data,
+	but disallow the combination of these options on the command line.
+	* config/bfin/bfin.h (TARGET_LEAF_ID_SHARED_LIBRARY, MASK_SEP_DATA
+	MASK_LEAF_ID_SHARED_LIBRARY, TARGET_SEP_DATA): New macros.
+	(DRIVER_SELF_SPECS): -mleaf-id-shared-library implies
+	-mid-shared-library.
+	(TARGET_SWITCHES): Add -mleaf-id-shared-library and -msep-data.
+	* doc/invoke.texi (Blackfin Options): Document new switches.
+
+	* config/bfin/bfin.c (bfin_function_ok_for_sibcall): Handle some
+	edge cases with local functions and TARGET_ID_SHARED_LIBRARY.
+
+	* tree-ssa-loop-ivopts.c (get_address_cost): Do not artificially
+	inflate costs for addresses with an out-of-bounds address.
+
 2006-11-19  Andrew Pinski  <pinskia@gmail.com>
 
 	PR rtl-opt/29879
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2006-11-17 13:28:19.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2006-11-20 21:25:19.000000000 +0000
@@ -1,3 +1,28 @@
+2006-11-20  Simon Martin  <simartin@users.sourceforge.net>
+
+	PR c++/29475
+	* cp-tree.h (enforce_access, perform_or_defer_access_check): Added an
+	extra argument that represents the declaration to use to print
+	potential error messages.
+	* init.c (build_offset_ref): Adjusted the call to
+	perform_or_defer_access_check.
+	* class.c (alter_access, resolve_address_of_overloaded_function):
+	Likewise.
+	* decl.c (make_typename_type, make_unbound_class_template): Likewise. 
+	* search.c (lookup_member): Likewise.
+	* friend.c (add_friend): Likewise.
+	* parser.c (cp_parser_template_id,
+	cp_parser_pre_parsed_nested_name_specifier): Likewise.
+	* semantics.c (finish_non_static_data_member,
+	check_accessibility_of_qualified_id, finish_id_expression): Likewise.
+	(pop_to_parent_deferring_access_checks, perform_access_checks,
+	perform_or_defer_access_check): Adjusted the call to enforce_access.
+	* call.c (enforce_access): Use the new extra argument to build the
+	error message.
+	(build_op_delete_call): Adjusted the call to
+	perform_or_defer_access_check.
+	(build_over_call): Likewise.
+	
 2006-11-16  Dirk Mueller  <dmueller@suse.de>
 
 	* name-lookup.c (begin_scope): Use GGC_CNEW instead of


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]