A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Wed Sep 19 02:25:00 GMT 2007


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: 7027k
    Peak memory use before GGC: 1180k
    Peak memory use after GGC: 1079k
    Maximum of released memory in single GGC run: 126k
    Garbage: 249k
    Leak: 1084k
    Overhead: 141k
    GGC runs: 4

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 7043k
    Peak memory use before GGC: 1207k
    Peak memory use after GGC: 1107k
    Maximum of released memory in single GGC run: 128k
    Garbage: 252k
    Leak: 1116k
    Overhead: 145k
    GGC runs: 4

comparing empty function compilation at -O1 level:
    Overall memory needed: 7083k -> 7087k
    Peak memory use before GGC: 1180k
    Peak memory use after GGC: 1071k
    Maximum of released memory in single GGC run: 121k
    Garbage: 251k
    Leak: 1084k
    Overhead: 141k
    GGC runs: 3

comparing empty function compilation at -O2 level:
    Overall memory needed: 7099k -> 7107k
    Peak memory use before GGC: 1180k
    Peak memory use after GGC: 1072k
    Maximum of released memory in single GGC run: 121k
    Garbage: 255k
    Leak: 1085k
    Overhead: 142k
    GGC runs: 3

comparing empty function compilation at -O3 level:
    Overall memory needed: 7099k -> 7107k
    Peak memory use before GGC: 1180k
    Peak memory use after GGC: 1072k
    Maximum of released memory in single GGC run: 121k
    Garbage: 255k
    Leak: 1085k
    Overhead: 142k
    GGC runs: 3

comparing combine.c compilation at -O0 level:
    Overall memory needed: 22043k -> 22047k
    Peak memory use before GGC: 8285k
    Peak memory use after GGC: 7624k
    Maximum of released memory in single GGC run: 1580k
    Garbage: 38811k
    Leak: 6169k
    Overhead: 5021k
    GGC runs: 369

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 24055k
    Peak memory use before GGC: 10115k
    Peak memory use after GGC: 9389k
    Maximum of released memory in single GGC run: 1875k
    Garbage: 39134k
    Leak: 8996k
    Overhead: 5693k
    GGC runs: 343

comparing combine.c compilation at -O1 level:
    Overall memory needed: 33131k -> 33127k
    Peak memory use before GGC: 17056k
    Peak memory use after GGC: 16868k
    Maximum of released memory in single GGC run: 1379k
    Garbage: 52440k
    Leak: 6308k
    Overhead: 6002k
    GGC runs: 440

comparing combine.c compilation at -O2 level:
    Overall memory needed: 35391k -> 35379k
    Peak memory use before GGC: 17127k
    Peak memory use after GGC: 16957k
    Maximum of released memory in single GGC run: 1335k
    Garbage: 71352k
    Leak: 6632k
    Overhead: 8254k
    GGC runs: 507

comparing combine.c compilation at -O3 level:
    Overall memory needed: 38815k -> 38807k
    Peak memory use before GGC: 17337k
    Peak memory use after GGC: 17010k
    Maximum of released memory in single GGC run: 2130k
    Garbage: 92707k -> 92745k
    Leak: 6750k
    Overhead: 10758k -> 10759k
    GGC runs: 537

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 138507k -> 138511k
    Peak memory use before GGC: 58644k
    Peak memory use after GGC: 32137k
    Maximum of released memory in single GGC run: 34144k
    Garbage: 131586k
    Leak: 8909k
    Overhead: 14830k
    GGC runs: 295

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 139751k -> 139759k
    Peak memory use before GGC: 59793k
    Peak memory use after GGC: 33286k
    Maximum of released memory in single GGC run: 34144k
    Garbage: 132063k
    Leak: 10345k
    Overhead: 15211k
    GGC runs: 291

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 149715k -> 149739k
    Peak memory use before GGC: 57137k
    Peak memory use after GGC: 50907k
    Maximum of released memory in single GGC run: 24233k
    Garbage: 212481k
    Leak: 9801k
    Overhead: 24835k
    GGC runs: 319

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 187283k -> 187275k
    Peak memory use before GGC: 57772k
    Peak memory use after GGC: 52500k
    Maximum of released memory in single GGC run: 22973k
    Garbage: 253948k
    Leak: 10889k
    Overhead: 30581k
    GGC runs: 350

comparing insn-attrtab.c compilation at -O3 level:
  Amount of produced GGC garbage increased from 280710k to 281995k, overall 0.46%
  Amount of memory still referenced at the end of compilation increased from 10894k to 10925k, overall 0.28%
    Overall memory needed: 194519k
    Peak memory use before GGC: 69764k -> 69771k
    Peak memory use after GGC: 63198k -> 63204k
    Maximum of released memory in single GGC run: 23355k -> 23494k
    Garbage: 280710k -> 281995k
    Leak: 10894k -> 10925k
    Overhead: 32348k -> 32460k
    GGC runs: 350 -> 356

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 155472k -> 155252k
    Peak memory use before GGC: 89723k
    Peak memory use after GGC: 88830k
    Maximum of released memory in single GGC run: 18062k
    Garbage: 210310k -> 210406k
    Leak: 53020k
    Overhead: 26478k -> 26479k
    GGC runs: 418

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 174580k
    Peak memory use before GGC: 101166k
    Peak memory use after GGC: 100164k
    Maximum of released memory in single GGC run: 18248k
    Garbage: 215902k -> 215996k
    Leak: 74843k
    Overhead: 31887k -> 31887k
    GGC runs: 392

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 121731k -> 121643k
    Peak memory use before GGC: 88622k
    Peak memory use after GGC: 87745k
    Maximum of released memory in single GGC run: 17329k
    Garbage: 297826k -> 297883k
    Leak: 52266k
    Overhead: 30850k -> 30848k
    GGC runs: 516

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 127539k -> 127603k
    Peak memory use before GGC: 88802k
    Peak memory use after GGC: 87914k
    Maximum of released memory in single GGC run: 17313k
    Garbage: 364715k -> 364764k
    Leak: 53354k -> 53343k
    Overhead: 38016k -> 38017k
    GGC runs: 594 -> 593

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Amount of produced GGC garbage increased from 391468k to 396282k, overall 1.23%
  Amount of memory still referenced at the end of compilation increased from 53602k to 53721k, overall 0.22%
    Overall memory needed: 130955k -> 131223k
    Peak memory use before GGC: 89908k
    Peak memory use after GGC: 89013k
    Maximum of released memory in single GGC run: 17671k
    Garbage: 391468k -> 396282k
    Leak: 53602k -> 53721k
    Overhead: 40419k -> 40904k
    GGC runs: 610 -> 617

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 379339k
    Peak memory use before GGC: 101510k
    Peak memory use after GGC: 57163k
    Maximum of released memory in single GGC run: 50582k
    Garbage: 179454k
    Leak: 6299k
    Overhead: 30876k
    GGC runs: 105

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 380147k
    Peak memory use before GGC: 102144k
    Peak memory use after GGC: 57797k
    Maximum of released memory in single GGC run: 50583k
    Garbage: 179559k
    Leak: 8007k
    Overhead: 31342k
    GGC runs: 110

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 296999k -> 297111k
    Peak memory use before GGC: 80813k
    Peak memory use after GGC: 73201k
    Maximum of released memory in single GGC run: 40017k
    Garbage: 236017k
    Leak: 15637k
    Overhead: 31649k
    GGC runs: 103

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 271175k -> 271295k
    Peak memory use before GGC: 78187k
    Peak memory use after GGC: 73201k
    Maximum of released memory in single GGC run: 33750k
    Garbage: 246060k
    Leak: 15726k
    Overhead: 33716k
    GGC runs: 116

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 1017567k -> 1017711k
    Peak memory use before GGC: 166829k
    Peak memory use after GGC: 156393k
    Maximum of released memory in single GGC run: 83495k
    Garbage: 357360k
    Leak: 25869k
    Overhead: 46221k
    GGC runs: 97

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-09-18 07:47:08.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-09-19 00:02:28.000000000 +0000
@@ -1,3 +1,71 @@
+2007-09-18  Richard Sandiford  <rsandifo@nildram.co.uk>
+
+	* dse.c (find_shift_sequence): Temporarily revert to forbidding
+	word shifts.
+
+2007-09-18  Rask Ingemann Lambertsen  <rask@sygehus.dk>
+
+	PR target/33388
+	PR target/33397
+	* config/fr30/fr30.md (addsi3): Check REG_P() before calling REGNO().
+	(addsi_small_int): Likewise.
+	(addsi_big_int): Use rtx_equal_p() instead of REGNO() comparison.
+	(one_cmplsi2): Likewise.
+	(negsi2): Delete.
+	(enter_func): Expand insn using hard_frame_pointer_rtx and
+	stack_pointer_rtx.
+	(*enter_func): New.
+	* config/fr30/fr30.c (fr30_expand_prologue): Check for
+	hard_frame_pointer_rtx instead of using REGNO() check.
+	Properly sign extend GEN_INT() argument.
+
+2007-09-18  Roman Zippel <zippel@linux-m68k.org>
+
+	* config/m68k/m68k.c (override_options): Remove USE_GAS,
+	use %. syntax.
+	(output_dbcc_and_branch, output_scc_di): Replace all jbcc
+	alternatives with just jcc.
+	* config/m68k/m68k.md (addsi_lshrsi_31, beq0_di, bne0_di,
+	bge0_di, blt0_di, bgtu, bltu, bgeu, bleu, bgtu_rev,
+	bltu_rev, bgeu_rev, bleu_rev, jump, dbne_hi, dbne_si,
+	dbge_hi, dbge_si): Likewise.
+
+2007-09-18  Roman Zippel <zippel@linux-m68k.org>
+
+	* config/m68k/m68k.md (beq, bne, bgt, blt, bge, ble, bordered,
+	bunordered, buneq, bunge, bungt, bunle, bunlt, bltgt, beq_rev,
+	bne_rev, bgt_rev, blt_rev, bge_rev, ble_rev, bordered_rev,
+	bunordered_rev, buneq_rev, bunge_rev, bungt_rev, bunle_rev,
+	bunlt_rev, bltgt_rev): Replace all fbcc with fjcc.
+
+2007-09-18  Maxim Kuvyrkov  <maxim@codesourcery.com>
+
+	* config/m68k/m68k-devices.def (51qe): New device.
+	* config/m68k/m68k.c (FL_FOR_isa_c): Remove division unit.  Add it
+	to all uses of FL_FOR_isa_c for compatibility.
+	(all_microarchs): Add cfv1 microarchitecture.
+	(m68k_handle_option): Handle m51qe option.
+	* config/m68k/m68k.h (TARGET_CPU_CPP_BUILTINS): Handle 51QE.
+	(TUNE_CFV1): New macro.
+	(enum uarch_type): Add ucfv1.
+	* doc/invoke.texi: Document 51qe device and cfv1 microarchitecture.
+	
+2007-09-18  Richard Guenther  <rguenther@suse.de>
+
+	PR tree-optimization/31863
+	* tree-ssa-structalias.c (create_variable_info_for): Always
+	free the fieldstack.
+
+2007-09-18  Dorit Nuzman  <dorit@il.ibm.com>
+
+	* opts.c (decode_options): Enable vectorization under -O3.
+
+2007-09-18  Richard Guenther  <rguenther@suse.de>
+
+	PR tree-optimization/33340
+	* tree-ssa-sccvn.c (set_ssa_val_to): Do not set values to
+	SSA_NAMEs that occur in abnormal PHI nodes.
+
 2007-09-17  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
 	* tree-cfg.c (is_ctrl_altering_stmt, tree_block_ends_with_call_p):
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2007-09-16 23:20:46.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2007-09-19 00:02:27.000000000 +0000
@@ -1,3 +1,48 @@
+2007-09-18  Jason Merrill  <jason@redhat.com>
+
+	PR c++/17743
+	* pt.c (apply_late_template_attributes): Set processing_template_decl.
+	(tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
+	ATTR_FLAG_TYPE_IN_PLACE.
+	(tsubst): Do unqualified lookup to find typedefs from current class.
+	[ARRAY_TYPE]: Propagate alignment info.
+	* decl2.c (is_late_template_attribute): Only defer handling of
+	attribute aligned if the expression is dependent.
+	(save_template_attributes): If we're deferring any attributes,
+	make this a naming typedef.
+
+2007-09-18  Paolo Carlini  <pcarlini@suse.de>
+
+	PR c++/33462 (again)
+	* cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
+	va_arg instead of __builtin_va_arg.
+
+2007-09-18  Paolo Carlini  <pcarlini@suse.de>
+
+	PR c++/33462
+	* cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
+	(pp_cxx_primary_expression): Use it.
+	* cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
+	* error.c (dump_expr): Use it.
+
+2007-09-18  Paolo Carlini  <pcarlini@suse.de>
+
+	PR c++/33463
+	* cxx-pretty-print.c (pp_cxx_postfix_expression): Split
+	out case TYPEID_EXPR to...
+	(pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
+	and pp_cxx_right_paren.
+	* cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
+	* error.c (dump_expr): Use it.
+
+2007-09-18  Paolo Carlini  <pcarlini@suse.de>
+
+	PR c++/33464
+	* cxx-pretty-print.c (pp_cxx_trait_expression): Add.
+	(pp_cxx_primary_expression): Use it.
+	* cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
+	* error.c (dump_expr): Use it.
+
 2007-09-16  Paolo Carlini  <pcarlini@suse.de>
 
 	PR c++/33124
@@ -6,17 +51,12 @@
 
 2007-09-16  Nathan Sidwell  <nathan@codesourcery.com>
 
-	cp/
 	PR c++/32756
 	* call.c (maybe_handle_implicit_object): Set this_p, clear
 	rvaluedness_matches_p.
 	(compare_ics): Do not compare rvaluedness matching when one of the
 	operands is an implicit object.
 
-	testsuite/
-	PR c++/32756
-	* g++.dg/overload/operator3.C: New.
-
 2007-09-14  Jason Merrill  <jason@redhat.com>
 
 	PR c++/17743, c++/19163


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.



More information about the Gcc-regression mailing list