This is the mail archive of the gcc-regression@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

A recent patch increased GCC's memory consumption!


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:
  Peak amount of GGC memory allocated before garbage collecting increased from 3379k to 3384k, overall 0.15%
  Amount of produced GGC garbage increased from 521k to 525k, overall 0.61%
    Overall memory needed: 8333k -> 8332k
    Peak memory use before GGC: 3379k -> 3384k
    Peak memory use after GGC: 3030k -> 3031k
    Maximum of released memory in single GGC run: 349k -> 353k
    Garbage: 521k -> 525k
    Leak: 3782k -> 3783k
    Overhead: 911k -> 912k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
  Peak amount of GGC memory allocated before garbage collecting increased from 3407k to 3411k, overall 0.12%
  Amount of produced GGC garbage increased from 524k to 527k, overall 0.61%
    Overall memory needed: 8349k -> 8348k
    Peak memory use before GGC: 3407k -> 3411k
    Peak memory use after GGC: 3057k -> 3059k
    Maximum of released memory in single GGC run: 350k -> 352k
    Garbage: 524k -> 527k
    Leak: 3815k -> 3816k
    Overhead: 916k -> 916k
    GGC runs: 3

comparing empty function compilation at -O1 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 3379k to 3384k, overall 0.15%
  Amount of produced GGC garbage increased from 527k to 530k, overall 0.61%
    Overall memory needed: 8389k -> 8388k
    Peak memory use before GGC: 3379k -> 3384k
    Peak memory use after GGC: 3030k -> 3031k
    Maximum of released memory in single GGC run: 349k -> 353k
    Garbage: 527k -> 530k
    Leak: 3785k -> 3786k
    Overhead: 912k -> 913k
    GGC runs: 3

comparing empty function compilation at -O2 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 3380k to 3384k, overall 0.12%
  Amount of produced GGC garbage increased from 531k to 534k, overall 0.60%
    Overall memory needed: 8385k -> 8384k
    Peak memory use before GGC: 3380k -> 3384k
    Peak memory use after GGC: 3030k -> 3031k
    Maximum of released memory in single GGC run: 350k -> 353k
    Garbage: 531k -> 534k
    Leak: 3785k -> 3786k
    Overhead: 913k -> 913k
    GGC runs: 3

comparing empty function compilation at -O3 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 3380k to 3384k, overall 0.12%
  Amount of produced GGC garbage increased from 531k to 534k, overall 0.60%
    Overall memory needed: 8385k -> 8384k
    Peak memory use before GGC: 3380k -> 3384k
    Peak memory use after GGC: 3030k -> 3031k
    Maximum of released memory in single GGC run: 350k -> 353k
    Garbage: 531k -> 534k
    Leak: 3785k -> 3786k
    Overhead: 913k -> 913k
    GGC runs: 3

comparing combine.c compilation at -O0 level:
    Overall memory needed: 23825k -> 23832k
    Peak memory use before GGC: 10324k -> 10323k
    Peak memory use after GGC: 9551k -> 9553k
    Maximum of released memory in single GGC run: 1905k
    Garbage: 39083k -> 39084k
    Leak: 8839k -> 8840k
    Overhead: 5684k -> 5685k
    GGC runs: 254

comparing combine.c compilation at -O0 -g level:
  Amount of memory still referenced at the end of compilation increased from 11720k to 11733k, overall 0.12%
    Overall memory needed: 25705k -> 25700k
    Peak memory use before GGC: 11985k -> 11987k
    Peak memory use after GGC: 11343k -> 11345k
    Maximum of released memory in single GGC run: 1515k -> 1516k
    Garbage: 39401k -> 39408k
    Leak: 11720k -> 11733k
    Overhead: 6390k -> 6390k
    GGC runs: 250

comparing combine.c compilation at -O1 level:
    Overall memory needed: 37561k -> 37564k
    Peak memory use before GGC: 18979k -> 18980k
    Peak memory use after GGC: 18788k -> 18789k
    Maximum of released memory in single GGC run: 1369k -> 1370k
    Garbage: 53252k -> 53267k
    Leak: 8894k -> 8896k
    Overhead: 6743k -> 6744k
    GGC runs: 326

comparing combine.c compilation at -O2 level:
    Overall memory needed: 39589k -> 39596k
    Peak memory use before GGC: 19033k -> 19034k
    Peak memory use after GGC: 18844k -> 18845k
    Maximum of released memory in single GGC run: 1404k -> 1403k
    Garbage: 71762k -> 71804k
    Leak: 9015k -> 9017k
    Overhead: 8874k -> 8877k
    GGC runs: 387 -> 388

comparing combine.c compilation at -O3 level:
    Overall memory needed: 42229k -> 42240k
    Peak memory use before GGC: 19279k -> 19280k
    Peak memory use after GGC: 18971k -> 18972k
    Maximum of released memory in single GGC run: 2103k -> 2104k
    Garbage: 93376k -> 93378k
    Leak: 9138k -> 9135k
    Overhead: 11540k -> 11539k
    GGC runs: 417 -> 418

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 143153k -> 143140k
    Peak memory use before GGC: 60810k -> 60811k
    Peak memory use after GGC: 34060k -> 34061k
    Maximum of released memory in single GGC run: 34384k
    Garbage: 132266k -> 132297k
    Leak: 11345k -> 11330k
    Overhead: 14973k -> 14974k
    GGC runs: 198

comparing insn-attrtab.c compilation at -O0 -g level:
  Amount of memory still referenced at the end of compilation increased from 13038k to 13055k, overall 0.13%
    Overall memory needed: 144413k -> 144416k
    Peak memory use before GGC: 61972k -> 61973k
    Peak memory use after GGC: 35221k -> 35222k
    Maximum of released memory in single GGC run: 34385k
    Garbage: 132511k -> 132498k
    Leak: 13038k -> 13055k
    Overhead: 15371k -> 15371k
    GGC runs: 200 -> 201

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 154557k -> 155152k
    Peak memory use before GGC: 59308k -> 59309k
    Peak memory use after GGC: 55083k -> 55084k
    Maximum of released memory in single GGC run: 23586k
    Garbage: 217483k -> 217484k
    Leak: 11459k -> 11461k
    Overhead: 25167k -> 25167k
    GGC runs: 229

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 193605k -> 193592k
    Peak memory use before GGC: 59191k -> 59192k
    Peak memory use after GGC: 55144k -> 55145k
    Maximum of released memory in single GGC run: 21338k
    Garbage: 253194k -> 253148k
    Leak: 11454k -> 11455k
    Overhead: 30639k -> 30630k
    GGC runs: 254

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 199125k -> 199220k
    Peak memory use before GGC: 71747k -> 71748k
    Peak memory use after GGC: 65978k -> 65980k
    Maximum of released memory in single GGC run: 22951k -> 22952k
    Garbage: 282518k -> 282512k
    Leak: 11463k -> 11464k
    Overhead: 32426k -> 32426k
    GGC runs: 257 -> 256

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 156764k -> 156836k
    Peak memory use before GGC: 91615k -> 91617k
    Peak memory use after GGC: 90697k -> 90698k
    Maximum of released memory in single GGC run: 18003k -> 18004k
    Garbage: 210828k -> 210834k
    Leak: 55667k -> 55669k
    Overhead: 26875k -> 26876k
    GGC runs: 397

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 177448k -> 177816k
    Peak memory use before GGC: 104505k -> 104506k
    Peak memory use after GGC: 103469k -> 103471k
    Maximum of released memory in single GGC run: 18641k -> 18640k
    Garbage: 216686k -> 216685k
    Leak: 79096k -> 79098k
    Overhead: 32844k -> 32844k
    GGC runs: 373

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 153429k -> 153467k
    Peak memory use before GGC: 103599k
    Peak memory use after GGC: 102500k
    Maximum of released memory in single GGC run: 17401k
    Garbage: 332902k -> 332905k
    Leak: 55784k -> 55778k
    Overhead: 33932k -> 33932k
    GGC runs: 500

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 164237k -> 164143k
    Peak memory use before GGC: 104172k
    Peak memory use after GGC: 103140k -> 103138k
    Maximum of released memory in single GGC run: 17401k
    Garbage: 389313k -> 389202k
    Leak: 56465k -> 56466k
    Overhead: 40178k -> 40157k
    GGC runs: 557

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 168993k -> 168955k
    Peak memory use before GGC: 106511k -> 106512k
    Peak memory use after GGC: 105429k -> 105430k
    Maximum of released memory in single GGC run: 17830k -> 17829k
    Garbage: 432879k -> 432647k
    Leak: 57190k -> 57183k
    Overhead: 43799k -> 43791k
    GGC runs: 583

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 387675k -> 387677k
    Peak memory use before GGC: 103463k -> 103464k
    Peak memory use after GGC: 59116k -> 59118k
    Maximum of released memory in single GGC run: 50583k -> 50582k
    Garbage: 179669k -> 179673k
    Leak: 8994k -> 8995k
    Overhead: 31650k -> 31651k
    GGC runs: 65

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 388479k -> 388485k
    Peak memory use before GGC: 104109k -> 104111k
    Peak memory use after GGC: 59763k -> 59764k
    Maximum of released memory in single GGC run: 50582k -> 50583k
    Garbage: 179774k -> 179778k
    Leak: 10762k -> 10763k
    Overhead: 32146k -> 32146k
    GGC runs: 72

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 306705k -> 306648k
    Peak memory use before GGC: 84309k -> 84311k
    Peak memory use after GGC: 75962k -> 75963k
    Maximum of released memory in single GGC run: 39284k
    Garbage: 232735k -> 232739k
    Leak: 22612k -> 22614k
    Overhead: 32719k -> 32720k
    GGC runs: 71

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 314805k -> 315032k
    Peak memory use before GGC: 80948k -> 80949k
    Peak memory use after GGC: 75962k -> 75963k
    Maximum of released memory in single GGC run: 33013k -> 33017k
    Garbage: 242828k -> 242836k
    Leak: 22694k -> 22696k
    Overhead: 34950k -> 34951k
    GGC runs: 85

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 1031837k -> 1031836k
    Peak memory use before GGC: 184702k -> 184703k
    Peak memory use after GGC: 172218k -> 172219k
    Maximum of released memory in single GGC run: 80995k -> 80994k
    Garbage: 349825k -> 349837k
    Leak: 48692k -> 48694k
    Overhead: 47426k -> 47426k
    GGC runs: 67

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-07-18 11:07:19.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-07-19 03:33:21.000000000 +0000
@@ -1,3 +1,112 @@
+2007-07-18  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* Makefile.in (D32PBIT_FUNCS): Add _sd_to_tf and _tf_to_sd.
+	(D64PBIT_FUNCS): Add _dd_to_tf and _tf_to_dd.
+	(D128PBIT_FUNCS): Add _td_to_tf and _tf_to_td.
+
+	* config/dfp-bit.c: Empty for TFmode conversions.
+
+2007-07-18  Caroline Tice  <ctice@apple.com>
+	
+	* var-tracking.c (find_src_status):  Check for  COND_EXEC insns
+	and handle them correctly; check that src is not NULL before
+	trying to use it.
+	(find_src_set_src): Likewise.
+	
+2007-07-18  Bob Wilson  <bob.wilson@acm.org>
+	
+	* config/xtensa/xtensa.c (xtensa_expand_mask_and_shift): New.
+	(struct alignment_context, init_alignment_context): New.
+	(xtensa_expand_compare_and_swap, xtensa_expand_atomic): New.
+	* config/xtensa/xtensa.h (XCHAL_HAVE_RELEASE_SYNC): Add default.
+	(XCHAL_HAVE_S32C1I): Likewise.
+	(TARGET_RELEASE_SYNC, TARGET_S32C1I): New.
+	* config/xtensa/xtensa.md (UNSPECV_MEMW): New constant.
+	(UNSPECV_S32RI, UNSPECV_S32C1I): Likewise.
+	(ATOMIC, HQI): New macros.
+	(memory_barrier, *memory_barrier): New.
+	(sync_lock_releasesi): New.
+	(sync_compare_and_swapsi, sync_compare_and_swap<mode>): New.
+	(sync_lock_test_and_set<mode>): New.
+	(sync_<atomic><mode>): New.
+	(sync_old_<atomic><mode>, sync_new_<atomic><mode>): New.
+	* config/xtensa/xtensa-protos.h (xtensa_expand_compare_and_swap): New.
+	(xtensa_expand_atomic): New.
+	
+2007-07-18  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+	PR target/30652
+
+	* builtins.c (expand_builtin_interclass_mathfn): Provide a generic
+	transformation for builtin ISNORMAL.
+	(expand_builtin): Handle BUILT_IN_ISNORMAL.
+	* builtins.def (BUILT_IN_ISNORMAL): New.
+	* doc/extend.texi: Document isnormal.
+
+2007-07-18  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+	PR target/30652
+
+	* builtins.c (expand_builtin_interclass_mathfn): Allow for missing
+	optabs infrastructure.  Provide generic implementation for
+	FINITE/ISFINITE.
+	(expand_builtin): Handle FINITE/ISFINITE.
+	(fold_builtin_classify): Make ISFINITE canonical instead of FINITE.
+	(fold_builtin_1): Likewise.
+
+	* builtins.def (BUILT_IN_ISFINITE): New.
+
+	* doc/extend.texi: Document isfinite.
+
+2007-07-18  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+	PR target/30652
+	PR middle-end/20558
+
+	* builtins.c (expand_builtin_interclass_mathfn): Provide a
+	generic fallback for isinf.
+	* c-cppbuiltin.c (builtin_define_float_constants): Move FP max
+	calculation code ...
+	* real.c (get_max_float): ... to here.
+	* real.h (get_max_float): New.
+
+2007-07-18  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+	PR middle-end/32668
+
+	* builtin-attrs.def (ATTR_TYPEGENERIC,
+	ATTR_CONST_NOTHROW_TYPEGENERIC): New.
+
+	* builtins.def (BUILT_IN_ISINF, BUILT_IN_ISNAN,
+	BUILT_IN_ISGREATER, BUILT_IN_ISGREATEREQUAL, BUILT_IN_ISLESS,
+	BUILT_IN_ISLESSEQUAL, BUILT_IN_ISLESSGREATER,
+	BUILT_IN_ISUNORDERED): Use ATTR_CONST_NOTHROW_TYPEGENERIC.
+
+	* c-common.c (handle_type_generic_attribute): New.
+	(c_common_attribute_table): Add "type generic".
+
+	* c-typeck.c (convert_arguments): Handle "type generic" functions.
+
+2007-07-18  Daniel Berlin  <dberlin@dberlin.org>
+
+	* tree-ssa-sccvn.c (try_to_simplify): Use valid_gimple_expression
+	* tree-ssa-propagate (valid_gimple_expression): Handle ADDR_EXPR
+	properly.
+
+2007-07-18  Rask Ingemann Lambertsen  <rask@sygehus.dk>
+
+	PR target/32808
+	* config/cris/cris.c (cris_print_index): Don't use XEXP before
+	checking that the operand is an expression.
+
+2007-07-19  Christoph von Wittich  <Christoph_vW@reactos.org>
+	    Danny Smith  <dannysmith@users.sourceforge.net>
+
+	PR/other 30335
+	* config/i386/host-mingw32.c (mingw32_gt_pch_use_address): Put
+	file mapping object in local namespace if Windows version later
+	than NT4
+
 2007-07-18  Richard Sandiford  <richard@codesourcery.com>
 
 	* config/arm/arm-protos.h (arm_cannot_force_const_mem): Declare.


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]