This is the mail archive of the
gcc-regression@gcc.gnu.org
mailing list for the GCC project.
A recent patch increased GCC's memory consumption in some cases!
- From: gcctest at suse dot de
- To: jh at suse dot cz, gcc-regression at gcc dot gnu dot org
- Date: Thu, 04 Jan 2007 17:22:30 +0000
- Subject: 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: 18333k
Peak memory use before GGC: 2264k
Peak memory use after GGC: 1954k
Maximum of released memory in single GGC run: 310k
Garbage: 444k
Leak: 2287k
Overhead: 455k
GGC runs: 3
comparing empty function compilation at -O0 -g level:
Overall memory needed: 18349k
Peak memory use before GGC: 2291k
Peak memory use after GGC: 1981k
Maximum of released memory in single GGC run: 310k
Garbage: 447k
Leak: 2320k
Overhead: 460k
GGC runs: 3
comparing empty function compilation at -O1 level:
Overall memory needed: 18445k
Peak memory use before GGC: 2264k
Peak memory use after GGC: 1954k
Maximum of released memory in single GGC run: 310k
Garbage: 450k
Leak: 2290k
Overhead: 456k
GGC runs: 4
comparing empty function compilation at -O2 level:
Overall memory needed: 18457k
Peak memory use before GGC: 2264k
Peak memory use after GGC: 1954k
Maximum of released memory in single GGC run: 310k
Garbage: 453k
Leak: 2290k
Overhead: 456k
GGC runs: 4
comparing empty function compilation at -O3 level:
Overall memory needed: 18457k
Peak memory use before GGC: 2264k
Peak memory use after GGC: 1954k
Maximum of released memory in single GGC run: 310k
Garbage: 453k
Leak: 2290k
Overhead: 456k
GGC runs: 4
comparing combine.c compilation at -O0 level:
Overall memory needed: 28613k
Peak memory use before GGC: 9312k
Peak memory use after GGC: 8864k
Maximum of released memory in single GGC run: 2606k
Garbage: 37286k
Leak: 6539k
Overhead: 4828k
GGC runs: 276
comparing combine.c compilation at -O0 -g level:
Overall memory needed: 30665k
Peak memory use before GGC: 10895k
Peak memory use after GGC: 10524k
Maximum of released memory in single GGC run: 2366k
Garbage: 37877k
Leak: 9414k
Overhead: 5530k
GGC runs: 271
comparing combine.c compilation at -O1 level:
Amount of produced GGC garbage increased from 54911k to 55524k, overall 1.12%
Amount of memory still referenced at the end of compilation decreased from 7673k to 6566k, overall -16.86%
Overall memory needed: 33538k
Peak memory use before GGC: 20889k -> 20886k
Peak memory use after GGC: 20680k -> 20677k
Maximum of released memory in single GGC run: 2163k -> 2262k
Garbage: 54911k -> 55524k
Leak: 7673k -> 6566k
Overhead: 9977k -> 9977k
GGC runs: 345 -> 350
comparing combine.c compilation at -O2 level:
Amount of produced GGC garbage increased from 70975k to 71550k, overall 0.81%
Amount of memory still referenced at the end of compilation decreased from 7795k to 6695k, overall -16.42%
Overall memory needed: 33538k
Peak memory use before GGC: 20917k -> 20907k
Peak memory use after GGC: 20708k -> 20700k
Maximum of released memory in single GGC run: 2347k -> 2202k
Garbage: 70975k -> 71550k
Leak: 7795k -> 6695k
Overhead: 11943k -> 11898k
GGC runs: 399 -> 406
comparing combine.c compilation at -O3 level:
Amount of produced GGC garbage increased from 104639k to 104785k, overall 0.14%
Amount of memory still referenced at the end of compilation decreased from 7505k to 6769k, overall -10.87%
Overall memory needed: 32766k
Peak memory use before GGC: 22012k -> 21970k
Peak memory use after GGC: 21429k -> 21365k
Maximum of released memory in single GGC run: 3788k -> 3136k
Garbage: 104639k -> 104785k
Leak: 7505k -> 6769k
Overhead: 16617k -> 16614k
GGC runs: 452 -> 455
comparing insn-attrtab.c compilation at -O0 level:
Overall memory needed: 89194k
Peak memory use before GGC: 70731k
Peak memory use after GGC: 44749k
Maximum of released memory in single GGC run: 37355k
Garbage: 131554k
Leak: 9580k
Overhead: 16626k
GGC runs: 208
comparing insn-attrtab.c compilation at -O0 -g level:
Overall memory needed: 90370k
Peak memory use before GGC: 71893k
Peak memory use after GGC: 46017k
Maximum of released memory in single GGC run: 37357k
Garbage: 132716k
Leak: 11269k
Overhead: 17020k
GGC runs: 207
comparing insn-attrtab.c compilation at -O1 level:
Overall memory needed: 101074k -> 100974k
Peak memory use before GGC: 76254k -> 76174k
Peak memory use after GGC: 72386k -> 72306k
Maximum of released memory in single GGC run: 31284k
Garbage: 229214k -> 229283k
Leak: 9525k -> 9405k
Overhead: 29492k -> 29492k
GGC runs: 219
comparing insn-attrtab.c compilation at -O2 level:
Overall memory needed: 113714k -> 112634k
Peak memory use before GGC: 83940k -> 83860k
Peak memory use after GGC: 78105k -> 78025k
Maximum of released memory in single GGC run: 29572k
Garbage: 281042k -> 281116k
Leak: 9522k -> 9402k
Overhead: 35349k -> 35350k
GGC runs: 242 -> 241
comparing insn-attrtab.c compilation at -O3 level:
Overall memory needed: 113706k -> 112662k
Peak memory use before GGC: 83981k -> 83901k
Peak memory use after GGC: 78145k -> 78065k
Maximum of released memory in single GGC run: 29761k -> 29760k
Garbage: 281891k -> 281946k
Leak: 9527k -> 9407k
Overhead: 35581k -> 35580k
GGC runs: 242
comparing Gerald's testcase PR8361 compilation at -O0 level:
Overall memory needed: 119830k
Peak memory use before GGC: 93043k
Peak memory use after GGC: 92120k
Maximum of released memory in single GGC run: 18912k
Garbage: 208226k
Leak: 49015k
Overhead: 21200k
GGC runs: 408
comparing Gerald's testcase PR8361 compilation at -O0 -g level:
Overall memory needed: 132298k
Peak memory use before GGC: 105318k
Peak memory use after GGC: 104273k
Maximum of released memory in single GGC run: 18749k
Garbage: 214805k
Leak: 72446k
Overhead: 27104k
GGC runs: 382
comparing Gerald's testcase PR8361 compilation at -O1 level:
Amount of memory still referenced at the end of compilation decreased from 60894k to 51042k, overall -19.30%
Overall memory needed: 139602k -> 139606k
Peak memory use before GGC: 112865k -> 112869k
Peak memory use after GGC: 111747k
Maximum of released memory in single GGC run: 17925k
Garbage: 438371k -> 437562k
Leak: 60894k -> 51042k
Overhead: 99311k -> 99303k
GGC runs: 549 -> 557
comparing Gerald's testcase PR8361 compilation at -O2 level:
Amount of memory still referenced at the end of compilation decreased from 61852k to 52005k, overall -18.94%
Overall memory needed: 139646k -> 139650k
Peak memory use before GGC: 112892k -> 112895k
Peak memory use after GGC: 111773k
Maximum of released memory in single GGC run: 17925k
Garbage: 493413k -> 492118k
Leak: 61852k -> 52005k
Overhead: 58683k -> 58659k
GGC runs: 594 -> 596
comparing Gerald's testcase PR8361 compilation at -O3 level:
Amount of memory still referenced at the end of compilation decreased from 61968k to 51977k, overall -19.22%
Overall memory needed: 141522k -> 141526k
Peak memory use before GGC: 114994k -> 114685k
Peak memory use after GGC: 113482k
Maximum of released memory in single GGC run: 18325k -> 18326k
Garbage: 515683k -> 512683k
Leak: 61968k -> 51977k
Overhead: 58932k -> 58603k
GGC runs: 598 -> 603
comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
Overall memory needed: 137274k
Peak memory use before GGC: 81607k
Peak memory use after GGC: 58487k
Maximum of released memory in single GGC run: 44559k
Garbage: 148154k
Leak: 8080k
Overhead: 25066k
GGC runs: 80
comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
Overall memory needed: 137658k
Peak memory use before GGC: 82253k
Peak memory use after GGC: 59132k
Maximum of released memory in single GGC run: 44207k
Garbage: 148372k
Leak: 9335k
Overhead: 25561k
GGC runs: 88
comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
Amount of produced GGC garbage increased from 281584k to 282084k, overall 0.18%
Overall memory needed: 424026k -> 421926k
Peak memory use before GGC: 200843k -> 200815k
Peak memory use after GGC: 194656k -> 194628k
Maximum of released memory in single GGC run: 112475k -> 112450k
Garbage: 281584k -> 282084k
Leak: 29807k -> 29804k
Overhead: 31953k -> 31999k
GGC runs: 91
comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
Amount of produced GGC garbage increased from 358637k to 359138k, overall 0.14%
Overall memory needed: 347870k -> 341726k
Peak memory use before GGC: 200838k -> 200810k
Peak memory use after GGC: 194651k -> 194623k
Maximum of released memory in single GGC run: 111903k -> 111878k
Garbage: 358637k -> 359138k
Leak: 30390k -> 30387k
Overhead: 47108k -> 47155k
GGC runs: 100
comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
Overall memory needed: 929806k -> 923074k
Peak memory use before GGC: 319683k -> 317277k
Peak memory use after GGC: 298157k -> 295752k
Maximum of released memory in single GGC run: 172128k -> 168455k
Garbage: 494413k -> 494906k
Leak: 45445k -> 45440k
Overhead: 59039k -> 59089k
GGC runs: 96
Head of the ChangeLog is:
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog 2007-01-04 00:47:58.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog 2007-01-04 15:35:26.000000000 +0000
@@ -1,3 +1,82 @@
+2007-01-04 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c (cgraph_release_function_body): New function.
+ (cgraph_remove_node): Use it.
+ * cgraph.h (cgraph_release_function_body): Declare.
+ * cgraphunit.c (cgraph_expand_function): Use it.
+ * ipa.c (cgraph_remove_unreahchable_nodes): Use it.
+ * tree-ssa.c (delete_tree_ssa): Allow to be called before aliasing
+ is initialized and while compilation of other function is running.
+ * tree-optimize.c (execute_free_cfg_annotations): Move code to clear
+ statement CFG annotations from here to ...
+ * tree-cfg.c (delete_tree_cfg_annotations): ... here.
+
+2007-01-04 Zdenek Dvorak <dvorakz@suse.cz>
+
+ * cfgloop.h (enum li_flags): Make the constants powers of two.
+
+2007-01-04 Jan Hubicka <jh@suse.cz>
+
+ * tree-inline.c (copy_bb): Insert new statements to statements_to_fold
+ set.
+ (fold_marked_statements): New function.
+ (optimize_inline_calls, tree_function_versioning): Fold new statements.
+ * tree-inline.h (copy_body_data): Add statements_to_fold.
+
+2007-01-03 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * config.gcc: Mention libgcc/config.host.
+ * Makefile.in: Update comments mentioning libgcc.
+ (LIBGCC, INSTALL_LIBGCC, GCC_PARTS, mklibgcc): Delete.
+ (all.cross, start.encap, rest.encap, rest.cross): Update
+ dependencies for libgcc move.
+ (libgcc.mk, LIBGCC_DEPS, libgcov.a, libgcc.a, stmp-multilib)
+ (clean-target, clean-target-libgcc): Delete.
+ (srcdirify, GCC_EXTRA_PARTS): New macros.
+ (libgcc-support, libgcc.mvars): New rules.
+ (distclean): Remove mention of mklibgcc.
+ (install): Don't reference INSTALL_LIBGCC.
+ (install-common): Don't reference EXTRA_PARTS.
+ (install-libgcc, install-multilib): Delete rules.
+ * mklibgcc.in: Delete file.
+ * doc/configfiles.texi: Don't mention mklibgcc.
+
+ * config/i386/t-darwin (SHLIB_VERPFX): Delete (moved to libgcc).
+ * config/i386/t-darwin64 (SHLIB_VERPFX): Likewise.
+ * config/rs6000/t-darwin (SHLIB_VERPFX): Likewise.
+ * config/rs6000/t-ppccomm (TARGET_LIBGCC2_CFLAGS, SHLIB_MAPFILES)
+ (mklibgcc, ldblspecs): Likewise.
+
+ * config/i386/t-nwld (libgcc.def, libc.def, libpcre.def)
+ (posixpre.def): Use $(T).
+ (SHLIB_EXT, SHLIB_NAME, SHLIB_SLIBDIR_QUAL, SHLIB_DEF, SHLIB_MAP)
+ (SHLIB_SRC, SHLIB_INSTALL): Delete.
+ (SHLIB_LINK): Make dummy.
+ * config/t-slibgcc-darwin: Delete contents except for dummy SHLIB_LINK.
+
+ * config/frv/t-linux (EXTRA_MULTILIB_PARTS): Clear.
+
+ * config/alpha/t-crtfm: Use $(T) in rules for EXTRA_PARTS.
+ * config/alpha/t-vms, config/alpha/t-vms64, config/fr30/t-fr30,
+ config/i386/t-rtems-i386, config/ia64/t-ia64, config/rs6000/t-beos,
+ config/rs6000/t-newas, config/sparc/t-elf: Likewise.
+
+ * configure.ac (all_outputs): Remove mklibgcc.
+ * configure: Regenerated.
+
+2007-01-03 Josh Conner <jconner@apple.com>
+
+ PR middle-end/29683
+ * calls.c (compute_argument_addresses): Set stack and stack_slot
+ for partial args, too.
+ (store_one_arg): Use locate.size.constant for the size when
+ generating a save_area.
+
+2007-01-03 Robert Kennedy <jimbob@google.com>
+
+ * tree-cfg.c (tree_merge_blocks): Release SSA_NAME phi results
+ whose definitions are deleted due to basic block merging.
+
2007-01-03 Paul Brook <paul@codesourcery.com>
PR target/16634
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.