A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Fri Mar 3 09:21:00 GMT 2006


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:
    Overall memory needed: 25276k
    Peak memory use before GGC: 9567k
    Peak memory use after GGC: 8914k
    Maximum of released memory in single GGC run: 2648k
    Garbage: 40068k
    Leak: 6741k
    Overhead: 5738k
    GGC runs: 313

comparing combine.c compilation at -O1 level:
    Overall memory needed: 26900k
    Peak memory use before GGC: 17438k
    Peak memory use after GGC: 17259k
    Maximum of released memory in single GGC run: 2318k
    Garbage: 61617k
    Leak: 6881k
    Overhead: 7268k
    GGC runs: 388

comparing combine.c compilation at -O2 level:
  Amount of memory still referenced at the end of compilation increased from 6966k to 6974k, overall 0.12%
    Overall memory needed: 26900k
    Peak memory use before GGC: 17441k
    Peak memory use after GGC: 17259k
    Maximum of released memory in single GGC run: 2409k
    Garbage: 81244k -> 81198k
    Leak: 6966k -> 6974k
    Overhead: 9889k -> 9887k
    GGC runs: 456

comparing combine.c compilation at -O3 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 18432k to 18509k, overall 0.42%
  Peak amount of GGC memory still allocated after garbage collectin increased from 17975k to 18003k, overall 0.16%
    Overall memory needed: 26900k
    Peak memory use before GGC: 18432k -> 18509k
    Peak memory use after GGC: 17975k -> 18003k
    Maximum of released memory in single GGC run: 3504k -> 3561k
    Garbage: 111814k -> 111753k
    Leak: 7055k
    Overhead: 13492k -> 13487k
    GGC runs: 514

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 80948k
    Peak memory use before GGC: 69509k
    Peak memory use after GGC: 45045k
    Maximum of released memory in single GGC run: 36220k
    Garbage: 146428k
    Leak: 10132k
    Overhead: 19750k
    GGC runs: 247

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 108252k
    Peak memory use before GGC: 91300k
    Peak memory use after GGC: 80536k
    Maximum of released memory in single GGC run: 32511k
    Garbage: 290789k
    Leak: 10074k
    Overhead: 34652k
    GGC runs: 244

comparing insn-attrtab.c compilation at -O2 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 97630k to 97742k, overall 0.11%
  Peak amount of GGC memory still allocated after garbage collectin increased from 84116k to 84229k, overall 0.13%
    Overall memory needed: 110896k -> 111012k
    Peak memory use before GGC: 97630k -> 97742k
    Peak memory use after GGC: 84116k -> 84229k
    Maximum of released memory in single GGC run: 32084k
    Garbage: 346101k -> 346099k
    Leak: 10057k
    Overhead: 44310k -> 44310k
    GGC runs: 273

comparing insn-attrtab.c compilation at -O3 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 97657k to 97772k, overall 0.12%
  Peak amount of GGC memory still allocated after garbage collectin increased from 84144k to 84258k, overall 0.14%
    Overall memory needed: 110952k -> 111120k
    Peak memory use before GGC: 97657k -> 97772k
    Peak memory use after GGC: 84144k -> 84258k
    Maximum of released memory in single GGC run: 32420k
    Garbage: 346740k -> 346733k
    Leak: 10061k
    Overhead: 44506k -> 44506k
    GGC runs: 279

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 118252k
    Peak memory use before GGC: 95028k
    Peak memory use after GGC: 94080k
    Maximum of released memory in single GGC run: 20299k
    Garbage: 223451k
    Leak: 49470k
    Overhead: 37086k
    GGC runs: 369

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 108456k
    Peak memory use before GGC: 95144k
    Peak memory use after GGC: 93152k
    Maximum of released memory in single GGC run: 20158k
    Garbage: 559381k
    Leak: 53307k
    Overhead: 62175k
    GGC runs: 525

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 111076k -> 111080k
    Peak memory use before GGC: 95144k
    Peak memory use after GGC: 93152k
    Maximum of released memory in single GGC run: 20158k
    Garbage: 685885k -> 685883k
    Leak: 54384k
    Overhead: 75154k -> 75155k
    GGC runs: 606 -> 608

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 110776k
    Peak memory use before GGC: 96538k
    Peak memory use after GGC: 94580k
    Maximum of released memory in single GGC run: 20583k
    Garbage: 746936k -> 746930k
    Leak: 55481k
    Overhead: 79215k -> 79215k
    GGC runs: 630 -> 629

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-03-02 22:39:36.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-03-03 09:12:05.000000000 +0000
@@ -1,3 +1,93 @@
+2006-03-03  Jakub Jelinek  <jakub@redhat.com>
+
+	* config/arm/unwind-arm.h (_Unwind_GetIPInfo): Fix pasto.
+
+2006-03-02  Roger Sayle  <roger@eyesopen.com>
+
+	* simplify-rtx.c (simplify_unary_operation): When simplifying
+	(neg (lt X 0)) into (ashiftrt X C) or (lshiftrt X C), make sure
+	that we perform the right shift in the appropriate mode, and
+	then extend or truncate the result to requested mode.
+
+2006-03-03  Zdenek Dvorak <dvorakz@suse.cz>
+
+	* gengtype.c (main): Handle double_int type.
+	* tree.h (struct tree_int_cst): Make type of int_cst double_int.
+	* double-int.c: New file.
+	* double-int.h: New file.
+	* system.h: Include doubleint.h.
+	* Makefile.in (SYSTEM_H): Include double-int.h.
+	(double-int.o): Add.
+
+2006-03-03  Joseph S. Myers  <joseph@codesourcery.com>
+
+	PR bootstrap/26478
+	* Makefile.in (stmp-int-hdrs): Remove include/unwind.h before
+	copying over it.
+
+2006-03-02  Zdenek Dvorak <dvorakz@suse.cz>
+
+	* tree-vrp.c (remove_range_assertions): Do not update statements
+	unnecessarily.
+
+2006-03-02  Zdenek Dvorak <dvorakz@suse.cz>
+
+	* cse.c (rest_of_handle_cse): Do not pass CLEANUP_PRE_LOOP to cfg
+	cleanup.
+	* gcse.c (rest_of_handle_gcse): Ditto.
+	* except.c (gate_handle_eh): Ditto.
+	* cfgcleanup.c (rest_of_handle_jump2): Ditto.
+	* basic-block.h (CLEANUP_PRE_LOOP): Remove.
+
+2006-03-02  Eric Christopher  <echristo@apple.com>
+
+	* config/i386/i386.c (machopic_output_stub): Add indirection to
+	jump.
+
+2006-03-02  Zdenek Dvorak <dvorakz@suse.cz>
+
+	* loop.c: Removed.
+
+2006-03-02  David S. Miller  <davem@sunset.davemloft.net>
+
+	Sun Niagara specific optimizations.
+	* config.gcc: Recognize niagara as target.
+	* config/sparc/sparc.h (SPARC_RELAXED_ORDERING): Mention Niagara.
+	(TARGET_CPU_niagara): Define.
+	(CPP_CPU64_DEFAULT_SPEC): Define __sparc_v9__ for Niagara.
+	(ASM_CPU64_DEFAULT_SPEC): Pass -Av9b for Niagara.
+	(CPP_CPU_SPEC): Handle -mcpu=niagara.
+	(ASM_CPU_SPEC): Likewise.
+	(PROCESSOR_NIAGARA): New enum entry.
+	(REGISTER_MOVE_COST): Handle Niagara.
+	(BRANCH_COST, PREFETCH_BLOCK, SIMULTANEOUS_PREFETCHES): Likewise.
+	* config/sparc/sparc.c (niagara_costs): New processor_costs entry.
+	(sparc_override_options): Recognize "niagara", set appropriate
+	default MASK_* values for it, and align functions to 32-bytes
+	by default just like ULTRASPARC/ULTRASPARC3.
+	(sparc_initialize_trampoline): Handle niagara like ultrasparc.
+	(sparc64_initialize_trampoline): Likewise.
+	(sparc_use_sched_lookahead): Use zero for niagara.
+	(sparc_issue_rate): Use one for niagara.
+	* config/sparc/niagara.md: New file.
+	* config/sparc/sparc.md: Include it.
+	* config/sparc/sol2-bi.h (CPP_CPU64_DEFAULT_SPEC,
+	ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC): Set appropriately
+	when default cpu is niagara.
+	(CPP_CPU_SPEC): Handle -mcpu=niagara.
+	(ASM_CPU_SPEC): Likewise.
+	* config/sparc/sol2.h (ASM_CPU_DEFAULT_SPEC): Set appropriately
+	when default cpu is niagara.
+	(ASM_CPU_SPEC): Handle -mcpu=niagara.
+	* config/sparc/linux64.h: Handle a default of TARGET_CPU_niagara
+	just like v9/ultrasparc/ultrasparc3.
+	* doc/invoke.texi: Add documentation for "niagara" and improve
+	existing documentation for ultrasparc variants.
+
+2006-03-02  Diego Novillo  <dnovillo@redhat.com>
+
+	* tree-ssa-operands.c (update_stmt_operands): Update documentation.
+
 2006-03-02  Richard Sandiford  <richard@codesourcery.com>
 
 	* doc/tm.texi (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Document.


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