Some aspect of GCC memory consumption increased by recent patch

gcctest@suse.de gcctest@suse.de
Wed Sep 29 05:09:00 GMT 2004


Hi,
Comparing memory consumption on compilation of combine.i and generate-3.4.ii I got:


comparing combine.c compilation at -O0 level:
    Overall memory needed: 25261k
    Peak memory use before GGC: 9345k
    Peak memory use after GGC: 8657k
    Maximum of released memory in single GGC run: 2939k
    Garbage: 43119k
    Leak: 6090k
    Overhead: 5694k
    GGC runs: 363

comparing combine.c compilation at -O1 level:
  Amount of produced GGC garbage increased from 70216k to 70523k, overall 0.44%
    Overall memory needed: 26697k -> 26721k
    Peak memory use before GGC: 9426k -> 9434k
    Peak memory use after GGC: 8872k -> 8870k
    Maximum of released memory in single GGC run: 2072k -> 2070k
    Garbage: 70216k -> 70523k
    Leak: 6674k
    Overhead: 11307k -> 11340k
    GGC runs: 578

comparing combine.c compilation at -O2 level:
  Amount of produced GGC garbage increased from 85287k to 85670k, overall 0.45%
    Overall memory needed: 29817k -> 29825k
    Peak memory use before GGC: 12773k
    Peak memory use after GGC: 12613k
    Maximum of released memory in single GGC run: 2596k
    Garbage: 85287k -> 85670k
    Leak: 6428k
    Overhead: 15829k -> 15887k
    GGC runs: 575 -> 576

comparing combine.c compilation at -O3 level:
  Amount of produced GGC garbage increased from 113839k to 114520k, overall 0.60%
    Overall memory needed: 21436k -> 21444k
    Peak memory use before GGC: 13082k -> 13077k
    Peak memory use after GGC: 12727k -> 12726k
    Maximum of released memory in single GGC run: 3454k -> 3453k
    Garbage: 113839k -> 114520k
    Leak: 6957k -> 6931k
    Overhead: 20906k -> 20982k
    GGC runs: 641

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 118920k
    Peak memory use before GGC: 79665k
    Peak memory use after GGC: 46310k
    Maximum of released memory in single GGC run: 43569k
    Garbage: 163564k
    Leak: 10645k
    Overhead: 20607k
    GGC runs: 307

comparing insn-attrtab.c compilation at -O1 level:
  Peak amount of GGC memory allocated before garbage collecting run decreased from 95523k to 91606k, overall -4.28%
  Peak amount of GGC memory still allocated after garbage collecting decreased from 73511k to 70899k, overall -3.68%
  Amount of produced GGC garbage increased from 463057k to 465894k, overall 0.61%
    Overall memory needed: 134928k -> 131952k
    Peak memory use before GGC: 95523k -> 91606k
    Peak memory use after GGC: 73511k -> 70899k
    Maximum of released memory in single GGC run: 42593k -> 42249k
    Garbage: 463057k -> 465894k
    Leak: 11078k -> 11076k
    Overhead: 75714k -> 74816k
    GGC runs: 462 -> 461

comparing insn-attrtab.c compilation at -O2 level:
  Peak amount of GGC memory allocated before garbage collecting run decreased from 111082k to 107165k, overall -3.66%
  Amount of produced GGC garbage increased from 512349k to 515181k, overall 0.55%
    Overall memory needed: 210908k -> 210328k
    Peak memory use before GGC: 111082k -> 107165k
    Peak memory use after GGC: 89070k -> 86458k
    Maximum of released memory in single GGC run: 36145k -> 36152k
    Garbage: 512349k -> 515181k
    Leak: 10960k -> 10958k
    Overhead: 83752k -> 82852k
    GGC runs: 385 -> 384

comparing insn-attrtab.c compilation at -O3 level:
  Peak amount of GGC memory allocated before garbage collecting run decreased from 111087k to 107170k, overall -3.65%
  Amount of produced GGC garbage increased from 513261k to 516091k, overall 0.55%
    Overall memory needed: 210916k -> 210320k
    Peak memory use before GGC: 111087k -> 107170k
    Peak memory use after GGC: 89075k -> 86463k
    Maximum of released memory in single GGC run: 36146k -> 36152k
    Garbage: 513261k -> 516091k
    Leak: 11006k -> 11004k
    Overhead: 83906k -> 83007k
    GGC runs: 393 -> 392

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 114044k
    Peak memory use before GGC: 90997k
    Peak memory use after GGC: 89747k
    Maximum of released memory in single GGC run: 20088k
    Garbage: 262334k
    Leak: 60277k
    Overhead: 47622k
    GGC runs: 374

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 105272k -> 105256k
    Peak memory use before GGC: 90059k
    Peak memory use after GGC: 88623k
    Maximum of released memory in single GGC run: 19791k
    Garbage: 596427k -> 596478k
    Leak: 62370k
    Overhead: 131739k -> 131743k
    GGC runs: 606 -> 605

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 105676k
    Peak memory use before GGC: 90059k
    Peak memory use after GGC: 88623k
    Maximum of released memory in single GGC run: 19790k
    Garbage: 648980k -> 649004k
    Leak: 62922k
    Overhead: 154782k -> 154789k
    GGC runs: 637 -> 638

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 107972k -> 107980k
    Peak memory use before GGC: 91627k
    Peak memory use after GGC: 90205k
    Maximum of released memory in single GGC run: 20194k
    Garbage: 685040k -> 685138k
    Leak: 63342k -> 63350k
    Overhead: 164082k -> 164098k
    GGC runs: 625 -> 627

Head of changelog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2004-09-28 23:16:40.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2004-09-29 03:54:30.000000000 +0000
@@ -1,5 +1,78 @@
 2004-09-28  Richard Henderson  <rth@redhat.com>
 
+	PR 15089
+	* tree-ssa-copy.c (may_propagate_copy_into_asm): New.
+	* tree-flow.h (may_propagate_copy_into_asm): Declare.
+	* tree-ssa-ccp.c (replace_uses_in): Use it.
+	* tree-ssa-dom.c (cprop_operand): Likewise.
+
+2004-09-28 Jeff Law  <law@redhat.com>
+
+	* tree-ssa-threadupdate.c (create_block_for_threading):  Request
+	that no outgoing edges be left in the duplicate block.  Do no
+	update information on outgoing edges or PHI nodes in target
+	blocks here.
+	(remove_ctrl_stmt_and_useless_edges): Renamed from
+	remove_last_stmt_and_useless_edges.  Handle case where the
+	block is empty or has no control statements.  Do not update edge
+	flags here.
+	(thread_block): Create a template block rather than copying the
+	original block every time.  Create outgoing edges from the
+	duplicate blocks and update PHIs at the target of the outgoing
+	edges here.  Fix edge flags for the original block if necessary.
+	* cfghooks (duplicate_block): No longer assert that the original
+	block has incoming edges.
+
+2004-09-29  Hans-Peter Nilsson  <hp@bitrange.com>
+
+	* doc/extend.texi (Extended Asm): Add blurb about using Explicit
+	Reg Vars to enforce register allocation with general constraints.
+	(Explicit Reg Vars): Clarify relation to asm statements.
+	(Local Reg Vars): Similar.
+
+2004-09-28  Ulrich Weigand  <uweigand@de.ibm.com>
+
+	* sched-rgn.c (haifa_edge, edge_table, NEXT_IN, NEXT_OUT, FROM_BLOCK,
+	TO_BLOCK, nr_edges, in_edges, out_edges, IN_EDGES, OUT_EDGES,
+	build_control_flow, new_edge): Remove.
+	(schedule_insns): Remove edge_table/in_edges/out_edges cleanup.
+	(bitlst, bitlst_table_last, bitlst_table): Remove.
+	(bblst): Store basic_block pointer instead of block index.
+	(bblst_table): Likewise.
+	(edgelst): Store edge pointer instead of edge index.
+	(edgelst_table, edgelst_last): New variables.
+	(extract_bitlst): Rename to ...
+	(extract_edgelst): ... this.  Return edge pointers, not indices.
+	(split_edges): Update call.
+	(rgn_edges): Store edge pointers instead of indices.
+	(edge_to_bit): Remove.
+	(EDGE_TO_BIT): Store per-region edge index in edge->aux.
+	(SET_EDGE_TO_BIT): New macro.
+	(is_cfg_nonregular): Check for simple cases of unreachable blocks.
+	(find_rgns): Remove edge_list parameter.  Traverse standard CFG
+	data structures instead of haifa_edge et al.  Use edge pointers
+	instead of edge indices everywhere.
+	(compute_dom_prob_ps): Use standard CFG data structures.  Account
+	for exit edges.
+	(compute_trg_info): Likewise.
+	(propagate_deps): Likewise.
+	(debug_candidate): Account for bblst data structure change.
+	(check_live_1, update_live_1, is_pfree): Likewise.
+	(IS_REACHABLE): Use standard CFG data structures.
+	(init_ready_list): Update bblst_table/edgelst_table allocation.
+	(schedule_region): Update alloc/cleanup code to data structure
+	changes.  Use edge->aux to store per-region edge index.
+	(init_regions): No longer call build_control_flow.  Do not
+	create edge list any more.
+
+2004-09-28  Ulrich Weigand  <uweigand@de.ibm.com>
+
+	* cse.c (cse_insn): Avoid creating direct non-local jumps.
+	* combine.c (can_combine_p): Likewise.
+	* local-alloc. (update_equiv_regs): Likewise.
+
+2004-09-28  Richard Henderson  <rth@redhat.com>
+
 	PR 17531
 	* expr.c (expand_expr_addr_expr_1): Only assemble_external for decls.
 	Don't check VOIDmode here.  Force PLUS operands to common type.

I am friendly script caring about memory consumption in GCC.  Please contact
jh@suse.cz if something is going wrong.

The results can be reproduced by building 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.

Yours testing script.



More information about the Gcc-regression mailing list