A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Wed Jun 1 14:06:00 GMT 2005


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:
  Amount of produced GGC garbage increased from 42237k to 42280k, overall 0.10%
    Overall memory needed: 24820k
    Peak memory use before GGC: 9653k
    Peak memory use after GGC: 8965k
    Maximum of released memory in single GGC run: 2790k
    Garbage: 42237k -> 42280k
    Leak: 6704k -> 6706k
    Overhead: 5845k -> 5890k
    GGC runs: 329

comparing combine.c compilation at -O1 level:
  Amount of produced GGC garbage increased from 62923k to 62999k, overall 0.12%
    Overall memory needed: 27608k
    Peak memory use before GGC: 9161k
    Peak memory use after GGC: 8720k
    Maximum of released memory in single GGC run: 2204k
    Garbage: 62923k -> 62999k
    Leak: 7085k -> 7087k
    Overhead: 7557k -> 7636k
    GGC runs: 522

comparing combine.c compilation at -O2 level:
  Amount of produced GGC garbage increased from 88073k to 88162k, overall 0.10%
    Overall memory needed: 24824k
    Peak memory use before GGC: 18279k
    Peak memory use after GGC: 18093k
    Maximum of released memory in single GGC run: 2524k
    Garbage: 88073k -> 88162k
    Leak: 7050k
    Overhead: 10882k -> 10970k
    GGC runs: 483

comparing combine.c compilation at -O3 level:
  Amount of produced GGC garbage increased from 117449k to 117577k, overall 0.11%
    Overall memory needed: 25128k
    Peak memory use before GGC: 18289k
    Peak memory use after GGC: 18093k
    Maximum of released memory in single GGC run: 3094k
    Garbage: 117449k -> 117577k
    Leak: 7123k
    Overhead: 14428k -> 14555k
    GGC runs: 538

comparing insn-attrtab.c compilation at -O0 level:
  Amount of produced GGC garbage increased from 153491k to 153738k, overall 0.16%
    Overall memory needed: 85596k
    Peak memory use before GGC: 73395k
    Peak memory use after GGC: 45365k
    Maximum of released memory in single GGC run: 37613k
    Garbage: 153491k -> 153738k
    Leak: 11302k -> 11303k
    Overhead: 19577k -> 19826k
    GGC runs: 268

comparing insn-attrtab.c compilation at -O1 level:
  Amount of produced GGC garbage increased from 302936k to 303463k, overall 0.17%
    Overall memory needed: 101136k
    Peak memory use before GGC: 76439k
    Peak memory use after GGC: 65594k
    Maximum of released memory in single GGC run: 37093k
    Garbage: 302936k -> 303463k
    Leak: 11603k -> 11605k
    Overhead: 36645k -> 37174k
    GGC runs: 381

comparing insn-attrtab.c compilation at -O2 level:
  Amount of produced GGC garbage increased from 404108k to 404704k, overall 0.15%
    Overall memory needed: 154100k -> 154104k
    Peak memory use before GGC: 118406k
    Peak memory use after GGC: 93025k
    Maximum of released memory in single GGC run: 32950k
    Garbage: 404108k -> 404704k
    Leak: 11445k
    Overhead: 49977k -> 50573k
    GGC runs: 305

comparing insn-attrtab.c compilation at -O3 level:
  Amount of produced GGC garbage increased from 404897k to 405493k, overall 0.15%
    Overall memory needed: 154120k -> 154116k
    Peak memory use before GGC: 118408k
    Peak memory use after GGC: 93027k
    Maximum of released memory in single GGC run: 32950k
    Garbage: 404897k -> 405493k
    Leak: 11466k
    Overhead: 50099k -> 50696k
    GGC runs: 311

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 127328k
    Peak memory use before GGC: 103080k
    Peak memory use after GGC: 102057k
    Maximum of released memory in single GGC run: 21522k
    Garbage: 247319k -> 247550k
    Leak: 53798k
    Overhead: 42786k -> 43016k
    GGC runs: 347

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Amount of produced GGC garbage increased from 659498k to 660590k, overall 0.17%
    Overall memory needed: 121436k
    Peak memory use before GGC: 112522k
    Peak memory use after GGC: 100700k
    Maximum of released memory in single GGC run: 20025k
    Garbage: 659498k -> 660590k
    Leak: 58903k
    Overhead: 83377k -> 84468k
    GGC runs: 517

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Amount of produced GGC garbage increased from 764839k to 765967k, overall 0.15%
    Overall memory needed: 121412k
    Peak memory use before GGC: 112523k
    Peak memory use after GGC: 100700k
    Maximum of released memory in single GGC run: 20025k
    Garbage: 764839k -> 765967k
    Leak: 59599k
    Overhead: 102537k -> 103665k
    GGC runs: 608

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Amount of produced GGC garbage increased from 821336k to 822552k, overall 0.15%
    Overall memory needed: 124364k
    Peak memory use before GGC: 115265k
    Peak memory use after GGC: 102526k
    Maximum of released memory in single GGC run: 21385k
    Garbage: 821336k -> 822552k
    Leak: 60847k
    Overhead: 108837k -> 110053k
    GGC runs: 609

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2005-06-01 10:03:23.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2005-06-01 13:00:51.000000000 +0000
@@ -1,5 +1,36 @@
+2005-06-01  Jan Hubicka  <jh@suse.cz>
+
+	* except.c (struct eh_region): Kill unused fields.
+	* basic-block.h (struct basic_block_def): Likewise.
+
+2005-06-01  J"orn Rennecke <joern.rennecke@st.com>
+
+	PR rtl-optimization/21767
+	* rtl.h (function_invariant_p): Re-add declaration.
+	* reload1.c (function_invariant_p): No longer static.
+	* ifcvt.c (dead_or_predicable): Remove REG_EQUAL notes that
+	might have become invalid.
+
 2005-06-01  Jakub Jelinek  <jakub@redhat.com>
 
+	PR c/21536
+	PR c/20760
+	* gimplify.c (gimplify_decl_expr): Call gimplify_type_sizes
+	on variable sizes types if a decl is a pointer to a VLA.
+	(gimplify_type_sizes): Handle POINTER_TYPE and REFERENCE_TYPE.
+	Call gimplify_type_sizes on aggregate fields.  Prevent infinite
+	recursion.
+
+	* fold-const.c (fold_ternary): Optimize BIT_FIELD_REF of VECTOR_CST.
+
+	* config/i386/xmmintrin.h (_mm_setzero_ps, _mm_set_ss, _mm_set1_ps,
+	_mm_set_ps, _mm_setr_ps): Add __extension__.
+	* config/i386/emmintrin.h (_mm_set_sd, _mm_set1_pd, _mm_set_pd,
+	_mm_setr_pd, _mm_setzero_pd, _mm_set_epi64x, _mm_set_epi64x,
+	_mm_set_epi32, _mm_set_epi16, _mm_set_epi8, _mm_setzero_si128):
+	Likewise.
+	(_mm_clflush): Don't use return in void function.
+
 	* config/i386/emmintrin.h (_mm_castpd_ps, _mm_castpd_si128,
 	_mm_castps_pd, _mm_castps_si128, _mm_castsi128_ps, _mm_castsi128_pd):
 	Use __inline instead of inline.


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