A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Tue Sep 5 20:36: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: 24781k
    Peak memory use before GGC: 8930k
    Peak memory use after GGC: 8565k
    Maximum of released memory in single GGC run: 2576k
    Garbage: 34997k -> 34995k
    Leak: 6058k
    Overhead: 4736k -> 4736k
    GGC runs: 296

comparing combine.c compilation at -O1 level:
  Amount of produced GGC garbage increased from 54708k to 54876k, overall 0.31%
    Overall memory needed: 36201k -> 36209k
    Peak memory use before GGC: 17003k
    Peak memory use after GGC: 16831k
    Maximum of released memory in single GGC run: 2264k
    Garbage: 54708k -> 54876k
    Leak: 6079k -> 6071k
    Overhead: 5746k -> 5778k
    GGC runs: 373

comparing combine.c compilation at -O2 level:
  Amount of produced GGC garbage increased from 78368k to 78603k, overall 0.30%
    Overall memory needed: 26500k
    Peak memory use before GGC: 17000k
    Peak memory use after GGC: 16831k
    Maximum of released memory in single GGC run: 2253k -> 2254k
    Garbage: 78368k -> 78603k
    Leak: 6173k -> 6179k
    Overhead: 8265k -> 8312k
    GGC runs: 440 -> 441

comparing combine.c compilation at -O3 level:
  Amount of produced GGC garbage increased from 107163k to 107531k, overall 0.34%
    Overall memory needed: 25596k
    Peak memory use before GGC: 18090k
    Peak memory use after GGC: 17427k
    Maximum of released memory in single GGC run: 3325k
    Garbage: 107163k -> 107531k
    Leak: 6250k
    Overhead: 11415k -> 11488k
    GGC runs: 486 -> 487

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 83700k
    Peak memory use before GGC: 68249k
    Peak memory use after GGC: 43997k
    Maximum of released memory in single GGC run: 35709k
    Garbage: 126249k
    Leak: 9118k
    Overhead: 16889k
    GGC runs: 230

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 103604k -> 103084k
    Peak memory use before GGC: 83524k
    Peak memory use after GGC: 77617k
    Maximum of released memory in single GGC run: 31805k
    Garbage: 259521k -> 259630k
    Leak: 8930k
    Overhead: 28452k -> 28472k
    GGC runs: 232

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 105360k -> 105356k
    Peak memory use before GGC: 87821k
    Peak memory use after GGC: 79916k
    Maximum of released memory in single GGC run: 30384k
    Garbage: 305996k -> 306132k
    Leak: 8935k
    Overhead: 35479k -> 35504k
    GGC runs: 257

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 105392k
    Peak memory use before GGC: 87847k
    Peak memory use after GGC: 79943k
    Maximum of released memory in single GGC run: 30571k
    Garbage: 306586k -> 306723k
    Leak: 8938k
    Overhead: 35656k -> 35682k
    GGC runs: 261

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 116272k
    Peak memory use before GGC: 92435k
    Peak memory use after GGC: 91514k
    Maximum of released memory in single GGC run: 19648k
    Garbage: 199817k
    Leak: 47214k
    Overhead: 20461k
    GGC runs: 398

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 115252k
    Peak memory use before GGC: 97008k
    Peak memory use after GGC: 94817k
    Maximum of released memory in single GGC run: 18293k
    Garbage: 435519k -> 435942k
    Leak: 49028k -> 49027k
    Overhead: 31211k -> 31296k
    GGC runs: 550 -> 551

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Amount of produced GGC garbage increased from 522134k to 522665k, overall 0.10%
    Overall memory needed: 115280k
    Peak memory use before GGC: 97009k
    Peak memory use after GGC: 94817k
    Maximum of released memory in single GGC run: 18293k
    Garbage: 522134k -> 522665k
    Leak: 49743k -> 49742k
    Overhead: 39289k -> 39389k
    GGC runs: 627 -> 628

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 116640k
    Peak memory use before GGC: 98446k
    Peak memory use after GGC: 96093k
    Maximum of released memory in single GGC run: 18613k
    Garbage: 540713k -> 541232k
    Leak: 49722k -> 49722k
    Overhead: 40165k -> 40268k
    GGC runs: 638 -> 639

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 134136k
    Peak memory use before GGC: 81628k
    Peak memory use after GGC: 58507k
    Maximum of released memory in single GGC run: 45492k
    Garbage: 143523k
    Leak: 7142k
    Overhead: 25103k
    GGC runs: 87

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 426132k -> 424896k
    Peak memory use before GGC: 201177k
    Peak memory use after GGC: 196173k
    Maximum of released memory in single GGC run: 95153k
    Garbage: 272369k
    Leak: 47195k
    Overhead: 30026k
    GGC runs: 105

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 347492k -> 347364k
    Peak memory use before GGC: 208293k
    Peak memory use after GGC: 196536k
    Maximum of released memory in single GGC run: 96535k
    Garbage: 388086k
    Leak: 47779k
    Overhead: 47627k
    GGC runs: 111

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 536244k
    Peak memory use before GGC: 314603k
    Peak memory use after GGC: 292947k
    Maximum of released memory in single GGC run: 163427k
    Garbage: 487439k
    Leak: 65111k
    Overhead: 58883k
    GGC runs: 100

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-09-04 20:04:16.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-09-05 18:49:19.000000000 +0000
@@ -1,3 +1,39 @@
+2006-09-05  Paolo Bonzini  <bonzini@gnu.org>
+
+	PR rtl-optimization/26847
+	* simplify-rtx.c (struct simplify_plus_minus_op_data): Remove ix.
+	(simplify_plus_minus_op_data_cmp): For REGs, break ties on the regno.
+	(simplify_plus_minus): Count n_constants while filling ops.  Replace
+	qsort with insertion sort.  Before going through the array to simplify
+	pairs, sort it.  Delay early exit until after the first sort, exiting
+	only if no swaps occurred.  Simplify pairs in reversed order, without
+	special-casing the first iteration.  Pack ops after simplifying pairs.
+
+2006-09-05  Anatoly Sokolov <aesok@post.ru>
+
+        * config/avr/avr.c (avr_mcu_types): Add support for at90pwm1 device.
+        * config/avr/t-avr (MULTILIB_MATCHES): (Ditto.).
+        * config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): (Ditto.).
+        (avr_rtx_costs): Mark 'outer_code' argument with ATTRIBUTE_UNUSED.
+
+2006-09-05  Richard Guenther  <rguenther@suse.de>
+
+	PR tree-optimization/28900
+	* tree-if-conv.c (find_phi_replacement_condition): Gimplify
+	compound conditional before creating COND_EXPR condition.
+
+2006-09-05  Richard Guenther  <rguenther@suse.de>
+
+	PR tree-optimization/28905
+	* tree-vrp.c (fix_equivalence_set): Manually implement
+	!value_ranges_intersect_p to also handle symbolic ranges.
+
+2006-09-05  Richard Guenther  <rguenther@suse.de>
+
+	PR middle-end/28935
+	* tree-ssa-ccp.c (fold_stmt_r): Make sure to fold the condition
+	of a COND_EXPR.
+
 2006-09-04  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
 	PR rtl-optimization/27616


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