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: 18261k
    Peak memory use before GGC: 2233k
    Peak memory use after GGC: 1940k
    Maximum of released memory in single GGC run: 293k
    Garbage: 422k
    Leak: 2271k
    Overhead: 446k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 18277k
    Peak memory use before GGC: 2260k
    Peak memory use after GGC: 1967k
    Maximum of released memory in single GGC run: 293k
    Garbage: 425k
    Leak: 2303k
    Overhead: 450k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 18361k
    Peak memory use before GGC: 2233k
    Peak memory use after GGC: 1940k
    Maximum of released memory in single GGC run: 293k
    Garbage: 426k
    Leak: 2273k
    Overhead: 446k
    GGC runs: 4

comparing empty function compilation at -O2 level:
    Overall memory needed: 18373k
    Peak memory use before GGC: 2233k
    Peak memory use after GGC: 1940k
    Maximum of released memory in single GGC run: 293k
    Garbage: 430k
    Leak: 2273k
    Overhead: 447k
    GGC runs: 4

comparing empty function compilation at -O3 level:
    Overall memory needed: 18373k
    Peak memory use before GGC: 2233k
    Peak memory use after GGC: 1940k
    Maximum of released memory in single GGC run: 293k
    Garbage: 430k
    Leak: 2273k
    Overhead: 447k
    GGC runs: 4

comparing combine.c compilation at -O0 level:
    Overall memory needed: 28393k
    Peak memory use before GGC: 9268k
    Peak memory use after GGC: 8786k
    Maximum of released memory in single GGC run: 2643k
    Garbage: 37458k
    Leak: 6452k
    Overhead: 4868k
    GGC runs: 280

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 30477k
    Peak memory use before GGC: 10816k
    Peak memory use after GGC: 10446k
    Maximum of released memory in single GGC run: 2319k
    Garbage: 38030k
    Leak: 9328k
    Overhead: 5569k
    GGC runs: 272

comparing combine.c compilation at -O1 level:
    Overall memory needed: 39801k -> 39821k
    Peak memory use before GGC: 16872k
    Peak memory use after GGC: 16704k
    Maximum of released memory in single GGC run: 2231k -> 2254k
    Garbage: 58185k -> 58202k
    Leak: 6473k -> 6473k
    Overhead: 6255k -> 6269k
    GGC runs: 359

comparing combine.c compilation at -O2 level:
    Overall memory needed: 29386k
    Peak memory use before GGC: 16874k
    Peak memory use after GGC: 16704k
    Maximum of released memory in single GGC run: 3776k
    Garbage: 79521k -> 79514k
    Leak: 6589k -> 6589k
    Overhead: 8629k -> 8630k
    GGC runs: 416

comparing combine.c compilation at -O3 level:
    Overall memory needed: 29510k
    Peak memory use before GGC: 18390k
    Peak memory use after GGC: 17806k
    Maximum of released memory in single GGC run: 5531k
    Garbage: 116427k -> 116420k
    Leak: 6671k -> 6671k
    Overhead: 13263k -> 13262k
    GGC runs: 468

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 88530k
    Peak memory use before GGC: 70079k
    Peak memory use after GGC: 43585k
    Maximum of released memory in single GGC run: 37868k
    Garbage: 131134k
    Leak: 9274k
    Overhead: 16943k
    GGC runs: 216

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 89710k
    Peak memory use before GGC: 71240k
    Peak memory use after GGC: 44853k
    Maximum of released memory in single GGC run: 37869k
    Garbage: 132034k
    Leak: 11218k
    Overhead: 17339k
    GGC runs: 213

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 110266k -> 110262k
    Peak memory use before GGC: 85471k
    Peak memory use after GGC: 79438k
    Maximum of released memory in single GGC run: 31668k
    Garbage: 271364k
    Leak: 9336k
    Overhead: 28698k
    GGC runs: 223

comparing insn-attrtab.c compilation at -O2 level:
  Overall memory allocated via mmap and sbrk increased from 115938k to 120766k, overall 4.16%
    Overall memory needed: 115938k -> 120766k
    Peak memory use before GGC: 87633k
    Peak memory use after GGC: 80352k
    Maximum of released memory in single GGC run: 30219k
    Garbage: 310401k
    Leak: 9339k
    Overhead: 35209k
    GGC runs: 246

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 120774k
    Peak memory use before GGC: 87658k
    Peak memory use after GGC: 80378k
    Maximum of released memory in single GGC run: 30412k
    Garbage: 311241k
    Leak: 9342k
    Overhead: 35436k
    GGC runs: 250

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 118582k
    Peak memory use before GGC: 91843k
    Peak memory use after GGC: 90934k
    Maximum of released memory in single GGC run: 19241k
    Garbage: 209815k
    Leak: 47804k
    Overhead: 21134k
    GGC runs: 414

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 130990k
    Peak memory use before GGC: 104049k
    Peak memory use after GGC: 103007k
    Maximum of released memory in single GGC run: 18732k
    Garbage: 216401k
    Leak: 71322k
    Overhead: 27038k
    GGC runs: 385

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 119610k
    Peak memory use before GGC: 96238k
    Peak memory use after GGC: 93982k
    Maximum of released memory in single GGC run: 18069k
    Garbage: 446943k -> 446627k
    Leak: 49491k -> 49491k
    Overhead: 32619k -> 32420k
    GGC runs: 564

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 119630k
    Peak memory use before GGC: 96264k
    Peak memory use after GGC: 94009k
    Maximum of released memory in single GGC run: 18069k
    Garbage: 564910k -> 564573k
    Leak: 50412k -> 50411k
    Overhead: 42294k -> 42180k
    GGC runs: 624 -> 623

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 121402k
    Peak memory use before GGC: 97232k
    Peak memory use after GGC: 95640k
    Maximum of released memory in single GGC run: 18476k
    Garbage: 586090k -> 585824k
    Leak: 50363k -> 50363k
    Overhead: 43261k -> 43027k
    GGC runs: 633 -> 634

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 137618k
    Peak memory use before GGC: 81563k
    Peak memory use after GGC: 58443k
    Maximum of released memory in single GGC run: 45145k
    Garbage: 148487k
    Leak: 7540k
    Overhead: 25306k
    GGC runs: 82

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 137990k
    Peak memory use before GGC: 82209k
    Peak memory use after GGC: 59089k
    Maximum of released memory in single GGC run: 45210k
    Garbage: 148690k
    Leak: 9307k
    Overhead: 25801k
    GGC runs: 88

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 408590k -> 408426k
    Peak memory use before GGC: 194153k
    Peak memory use after GGC: 187972k
    Maximum of released memory in single GGC run: 94098k
    Garbage: 283874k
    Leak: 29776k
    Overhead: 29694k
    GGC runs: 98

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 329958k -> 330170k
    Peak memory use before GGC: 194146k
    Peak memory use after GGC: 187965k
    Maximum of released memory in single GGC run: 96112k
    Garbage: 364116k
    Leak: 30359k
    Overhead: 45444k
    GGC runs: 105

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 777786k -> 777850k
    Peak memory use before GGC: 308402k
    Peak memory use after GGC: 286746k
    Maximum of released memory in single GGC run: 162713k
    Garbage: 501959k
    Leak: 45412k
    Overhead: 57075k
    GGC runs: 98

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-12-08 10:37:54.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-12-09 03:03:21.000000000 +0000
@@ -1,3 +1,148 @@
+2006-12-08  Trevor Smigiel  <trevor_smigiel@playstation.sony.com>
+
+	* config/spu/spu-protos.h (spu_split_immediate): Renamed from
+	spu_split_address.
+	(cpat_const_p, gen_cpat_const): Add.
+	* config/spu/spu.c (immediate_class): New enum.
+	(cpat_info, classify_immediate): New.
+	(print_operand): Use S, D, T instead of F, G, H.  Use
+	classify_immediate.  Handle cpat cases.
+	(spu_split_immediate):  Renamed from spu_split_address.  Split all
+	immediates that can be split.
+	(immediate_load_p): Use classify_immediate.
+	(spu_legitimate_constant_p): Accept everything except some cases of
+	CONST_VECTOR.
+	(spu_expand_move): Use spu_split_immedate.
+	(fsmbi_const_p): Use classify_immediate.
+	(cpat_const_p): New.
+	(gen_cpat_const: New.
+	* config/spu/constraints.md (j,k,l): New constraints for cpat
+	instructions.
+	* config/spu/spu.md (unnamed splitter): Change address splitter to
+	handle all immediates.
+	(_mov<mode>, _movdi, _movti): Handle i, j, k constraints for cpat
+	instructions.
+	(cpat, _cpat, splitter): Generate a TImode constant for cpat patterns
+	when possible.
+
+2006-12-08  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+	PR target/30039
+	* pa.md (high:DI and lo_sum:DI): Handle 64-bit CONST_INTs in 32-bit
+	patterns.  Correct length of high:DI instruction sequence.
+
+2006-12-08  Mike Stump  <mrs@apple.com>
+
+	* config/rs6000/t-darwin (TARGET_LIBGCC2_CFLAGS): Build
+	libgcc with -mmacosx-version-min=10.4.
+	* config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Default to
+	G4 for 10.5+ unless doing kernel builds.
+
+2006-12-08  Uros Bizjak  <ubizjak@gmail.com>
+
+	PR target/30120
+	* reg-stack.c (convert_regs_entry): Mark current argument passing
+	registers as live.
+
+	* config/i386/i386.h (X87_REGPARM_MAX): Set to 0 to disable passing
+	of float arguments in x87 registers.
+
+2006-12-08  John David Anglin  <dave.anglin.@nrc-cnrc.gc.ca>
+
+	* pa.h (LEGITIMATE_CONSTANT_P): Simplify.
+
+2006-12-08  Mark Shinwell  <shinwell@codesourcery.com>
+
+	* recog.c (mode_dependent_address_p): Identify pre-increment,
+	pre-decrement, post-increment and post-decrement addressing as always
+	being mode-dependent.
+	* config/m32c/m32c.c (m32c_mode_dependent_address): Delete.
+	* config/m32c/m32c.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
+	* config/m32c/m32c-protos.h (m32c_mode_dependent_address): Delete.
+	* config/m32r/m32r.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete PRE_DEC,
+	PRE_INC and POST_INC checks.
+	* config/i386/i386.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
+	* config/sh/sh.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
+	* config/pdp11/pdp11.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
+	* config/avr/avr.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
+	* config/c4x/c4x.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete PRE_DEC,
+	PRE_INC, POST_DEC and POST_INC cases.
+	* config/stormy16/stormy16.c (xstormy16_mode_dependent_address_p):
+	Delete POST_INC and PRE_DEC cases.
+	* config/m68hc11/m68hc11.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to
+	no-op.
+	* config/cris/cris.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
+	* config/mn10300/mn10300.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to
+	no-op.
+	* config/ia64/ia64.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
+	* config/m68k/m68k.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
+	* config/rs6000/rs6000.c (rs6000_mode_dependent_address): Delete
+	PRE_INC and PRE_DEC cases.
+	* config/arc/arc.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
+	* config/mcore/mcore.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
+	* config/arm/arm.h (ARM_GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
+	(GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
+	* config/pa/pa.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
+	* config/vax/vax.c (vax_mode_dependent_address_p): Delete
+	auto-increment cases.
+	* config/h8300/h8300.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete
+	auto-increment cases.
+	* config/bfin/bfin.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
+
+2006-12-08  Andrew MacLeod  <amacleod@redhat.com>
+
+	* Makefile.in: Add new file tree-ssa-ter.c.
+	* tree-outof-ssa.c (struct temp_expr_table_d, new_temp_expr_table, 
+	free_temp_expr_table, add_value_to_version_list, 
+	add_value_to_partition_list, remove_value_from_partition_list, 
+	add_dependence, check_replaceable, finish_expr, mark_replaceable, 
+	kill_expr, kill_virtual_exprs, find_replaceable_in_bb, 
+	find_replaceable_exprs, dump_replaceable_exprs): Move to tree-ssa-ter.c.
+	* tree-ssa-live.h (find_replaceable_exprs, dump_replaceable_exprs): Add
+	prototypes.
+	* tree-ssa-ter.c: New file using code moved from tree-outof-ssa.c.
+	(struct value_expr_d): Remove.
+	(struct temp_expr_table_d): Rename fields, add explicit vector of
+	replaceable expressions instead of sharing.  Change value_expr_p's to 
+	bitmap.  Delete free_list.
+	(new_temp_expr_table): Rename fields, count number of ssa_names in
+	each partition.
+	(free_temp_expr_table): Rename field, free new fields.
+	(new_value_expr, free_value_expr, find_value_in_list, add_value_to_list,
+	add_info_to_list, remove_value_from_list): Delete.
+	(version_to_be_replaced_p): New.  Is an ssa-name replaceable?
+	(make_dependent_on_partition): New.  Set bit in version list, allocating
+	a bitmap if need be.
+	(add_to_partition_kill_list): New.  Set bit in the partition list,
+	allocating a bitmap if need be.
+	(remove_from_partition_kill_list): New.  Remove a bit from the
+	partition list, free the bitmap if it is empty.
+	(add_dependence): Use renamed field, cleanup.  Don't add a dependence
+	on partitions with only one member.
+	(is_replaceable_p): New.  Split out replaceability check from 
+	check_replaceable.
+	(process_replaceable): New.  Code split from check_replaceable.
+	(check_replaceable): Removed.
+	(finished_with_expr): Renamed from finish_expr.
+	(kill_expr): Use renamed fields and less parameters.
+	(kill_virtual_exprs): Less parameters.
+	(mark_replaceable): Use renamed fields.
+	(find_replaceable_in_bb): Use renamed fields, cleanup.
+	(find_replaceable_exprs): Use renamed routines, cleanup.
+	(dump_replaceable_exprs): Don't go past end of ssa_names list.
+	(debug_ter): New.  Debug routine to dump state.
+
+2006-12-08  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+	* config/bfin/bfin.c (effective_address_32bit_p): Return true for
+	anything involving the GOT.
+	(bfin_adjust_cost): Don't take the REGNO of a MEM.
+	(trapping_loads_p): Look inside the pattern of an insn to find the
+	SET.
+	* config/bfin/bfin.md (attr "type"): Add movcc.
+	(insn_reservation "alu"): Likewise.
+	(movsicc_insn1, movsicc_insn2): Change type to movcc.
+
 2006-12-07  Andrew Pinski  <andrew_pinski@playstation.sony.com>
 
 	* config/spu/spu-c.c (spu_build_overload_builtin): Delete.
@@ -366,12 +511,6 @@
 	(gfc_add_modify_stmt): New macro.
 	* fortran/f95-lang.c (lang_tree_node): Handle gimple statements.
 
-	2006-11-02  Aldy Hernandez  <aldyh@redhat.com>
-
-	* ada/ada-tree.h (lang_tree_node): Handle gimple tuples.
-	* ada/trans.c (gnat_gimplify_expr): Replace MODIFY_EXPR with
-	GIMPLE_MODIFY_STMT.
-
 	2006-11-01  Aldy Hernandez  <aldyh@redhat.com>
 
 	* Merge from mainline at revision 118200.


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]