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:
    Overall memory needed: 7028k -> 7027k
    Peak memory use before GGC: 1191k -> 1180k
    Peak memory use after GGC: 1091k -> 1079k
    Maximum of released memory in single GGC run: 125k -> 126k
    Garbage: 249k
    Leak: 1105k -> 1084k
    Overhead: 150k -> 141k
    GGC runs: 4

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 7044k -> 7043k
    Peak memory use before GGC: 1219k -> 1207k
    Peak memory use after GGC: 1118k -> 1107k
    Maximum of released memory in single GGC run: 128k
    Garbage: 252k
    Leak: 1138k -> 1116k
    Overhead: 155k -> 145k
    GGC runs: 4

comparing empty function compilation at -O1 level:
    Overall memory needed: 7088k -> 7083k
    Peak memory use before GGC: 1191k -> 1180k
    Peak memory use after GGC: 1083k -> 1071k
    Maximum of released memory in single GGC run: 121k
    Garbage: 251k
    Leak: 1106k -> 1084k
    Overhead: 151k -> 141k
    GGC runs: 3

comparing empty function compilation at -O2 level:
    Overall memory needed: 7100k -> 7099k
    Peak memory use before GGC: 1192k -> 1180k
    Peak memory use after GGC: 1083k -> 1072k
    Maximum of released memory in single GGC run: 121k
    Garbage: 255k
    Leak: 1107k -> 1085k
    Overhead: 152k -> 142k
    GGC runs: 3

comparing empty function compilation at -O3 level:
    Overall memory needed: 7100k -> 7099k
    Peak memory use before GGC: 1192k -> 1180k
    Peak memory use after GGC: 1083k -> 1072k
    Maximum of released memory in single GGC run: 121k
    Garbage: 255k
    Leak: 1107k -> 1085k
    Overhead: 152k -> 142k
    GGC runs: 3

comparing combine.c compilation at -O0 level:
    Overall memory needed: 22084k -> 22043k
    Peak memory use before GGC: 8321k -> 8285k
    Peak memory use after GGC: 7661k -> 7624k
    Maximum of released memory in single GGC run: 1581k -> 1580k
    Garbage: 38808k -> 38811k
    Leak: 6237k -> 6169k
    Overhead: 5054k -> 5021k
    GGC runs: 369

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 24100k -> 24055k
    Peak memory use before GGC: 10151k -> 10115k
    Peak memory use after GGC: 9425k -> 9389k
    Maximum of released memory in single GGC run: 1875k
    Garbage: 39162k -> 39134k
    Leak: 9064k -> 8996k
    Overhead: 5726k -> 5693k
    GGC runs: 341 -> 343

comparing combine.c compilation at -O1 level:
    Overall memory needed: 33168k -> 33131k
    Peak memory use before GGC: 17092k -> 17056k
    Peak memory use after GGC: 16904k -> 16868k
    Maximum of released memory in single GGC run: 1378k -> 1379k
    Garbage: 52447k -> 52440k
    Leak: 6376k -> 6308k
    Overhead: 6035k -> 6002k
    GGC runs: 439 -> 440

comparing combine.c compilation at -O2 level:
    Overall memory needed: 35428k -> 35391k
    Peak memory use before GGC: 17169k -> 17127k
    Peak memory use after GGC: 16993k -> 16957k
    Maximum of released memory in single GGC run: 1335k
    Garbage: 71359k -> 71352k
    Leak: 6703k -> 6632k
    Overhead: 8289k -> 8254k
    GGC runs: 507

comparing combine.c compilation at -O3 level:
    Overall memory needed: 38852k -> 38815k
    Peak memory use before GGC: 17368k -> 17337k
    Peak memory use after GGC: 17046k -> 17010k
    Maximum of released memory in single GGC run: 2130k
    Garbage: 92724k -> 92707k
    Leak: 6818k -> 6750k
    Overhead: 10792k -> 10758k
    GGC runs: 536 -> 537

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 138536k -> 138507k
    Peak memory use before GGC: 58675k -> 58644k
    Peak memory use after GGC: 32168k -> 32137k
    Maximum of released memory in single GGC run: 34144k
    Garbage: 131586k -> 131586k
    Leak: 8967k -> 8909k
    Overhead: 14859k -> 14830k
    GGC runs: 294 -> 295

comparing insn-attrtab.c compilation at -O0 -g level:
  Amount of produced GGC garbage increased from 131809k to 132063k, overall 0.19%
    Overall memory needed: 139792k -> 139751k
    Peak memory use before GGC: 59824k -> 59793k
    Peak memory use after GGC: 33317k -> 33286k
    Maximum of released memory in single GGC run: 34144k
    Garbage: 131809k -> 132063k
    Leak: 10643k -> 10345k
    Overhead: 15239k -> 15211k
    GGC runs: 289 -> 291

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 149760k -> 149715k
    Peak memory use before GGC: 57168k -> 57137k
    Peak memory use after GGC: 50938k -> 50907k
    Maximum of released memory in single GGC run: 24232k -> 24233k
    Garbage: 212484k -> 212481k
    Leak: 9859k -> 9801k
    Overhead: 24863k -> 24835k
    GGC runs: 319

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 187316k -> 187283k
    Peak memory use before GGC: 57802k -> 57772k
    Peak memory use after GGC: 52531k -> 52500k
    Maximum of released memory in single GGC run: 22973k
    Garbage: 253951k -> 253948k
    Leak: 10947k -> 10889k
    Overhead: 30609k -> 30581k
    GGC runs: 350

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 194548k -> 194519k
    Peak memory use before GGC: 69795k -> 69764k
    Peak memory use after GGC: 63228k -> 63198k
    Maximum of released memory in single GGC run: 23355k
    Garbage: 280713k -> 280710k
    Leak: 10952k -> 10894k
    Overhead: 32376k -> 32348k
    GGC runs: 350

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 155488k -> 155472k
    Peak memory use before GGC: 89723k
    Peak memory use after GGC: 88830k
    Maximum of released memory in single GGC run: 18062k
    Garbage: 210310k
    Leak: 53020k
    Overhead: 26478k
    GGC runs: 418

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 174576k -> 174580k
    Peak memory use before GGC: 101166k
    Peak memory use after GGC: 100164k
    Maximum of released memory in single GGC run: 18248k
    Garbage: 215902k
    Leak: 74843k
    Overhead: 31887k
    GGC runs: 392

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 121731k
    Peak memory use before GGC: 88622k
    Peak memory use after GGC: 87745k
    Maximum of released memory in single GGC run: 17329k
    Garbage: 297826k
    Leak: 52266k
    Overhead: 30850k
    GGC runs: 516

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 127539k
    Peak memory use before GGC: 88802k
    Peak memory use after GGC: 87914k
    Maximum of released memory in single GGC run: 17313k
    Garbage: 364715k
    Leak: 53354k
    Overhead: 38016k
    GGC runs: 594

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 130955k
    Peak memory use before GGC: 89908k
    Peak memory use after GGC: 89013k
    Maximum of released memory in single GGC run: 17671k
    Garbage: 391468k
    Leak: 53602k
    Overhead: 40419k
    GGC runs: 610

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 379411k -> 379339k
    Peak memory use before GGC: 101524k -> 101510k
    Peak memory use after GGC: 57178k -> 57163k
    Maximum of released memory in single GGC run: 50582k
    Garbage: 179457k -> 179454k
    Leak: 6325k -> 6299k
    Overhead: 30890k -> 30876k
    GGC runs: 105

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 380223k -> 380147k
    Peak memory use before GGC: 102158k -> 102144k
    Peak memory use after GGC: 57811k -> 57797k
    Maximum of released memory in single GGC run: 50583k
    Garbage: 179514k -> 179559k
    Leak: 8033k -> 8007k
    Overhead: 31355k -> 31342k
    GGC runs: 110

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 295568k -> 296999k
    Peak memory use before GGC: 80827k -> 80813k
    Peak memory use after GGC: 73215k -> 73201k
    Maximum of released memory in single GGC run: 40017k
    Garbage: 236019k -> 236017k
    Leak: 15663k -> 15637k
    Overhead: 31663k -> 31649k
    GGC runs: 103

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 271184k -> 271175k
    Peak memory use before GGC: 78201k -> 78187k
    Peak memory use after GGC: 73215k -> 73201k
    Maximum of released memory in single GGC run: 33754k -> 33750k
    Garbage: 246066k -> 246060k
    Leak: 15752k -> 15726k
    Overhead: 33730k -> 33716k
    GGC runs: 116

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 1017652k -> 1017567k
    Peak memory use before GGC: 166843k -> 166829k
    Peak memory use after GGC: 156407k -> 156393k
    Maximum of released memory in single GGC run: 83495k
    Garbage: 357355k -> 357360k
    Leak: 25895k -> 25869k
    Overhead: 46235k -> 46221k
    GGC runs: 97

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-09-17 15:32:20.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-09-18 07:47:08.000000000 +0000
@@ -1,3 +1,74 @@
+2007-09-17  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+	* tree-cfg.c (is_ctrl_altering_stmt, tree_block_ends_with_call_p):
+	Don't use const_get_call_expr_in.
+	* tree-gimple.c (const_get_call_expr_in): Delete.
+	* tree-gimple.h (const_get_call_expr_in): Likewise.
+
+2007-09-18  Richard Sandiford  <rsandifo@nildram.co.uk>
+
+	* df-scan.c (df_notes_rescan): Do nothing if the instruction does
+	not yet have a basic block.
+	* dse.c (find_shift_sequence): Don't set DF_NO_INSN_RESCAN.
+
+2007-09-18  Richard Sandiford  <rsandifo@nildram.co.uk>
+
+	* config/mips/mips.c (mips_file_start): Add ".previous" directives
+	to both ".section"s.
+
+2007-09-17  Richard Sandiford  <rsandifo@nildram.co.uk>
+
+	* config/mips/mips.c (mips_output_mi_thunk): Use
+	mips_function_ok_for_sibcall and const_call_insn_operand
+	to determine if a direct sibcall is allowed.  Use
+	mips_classify_symbol to determine a global pointer is needed.
+
+2007-09-17  Richard Sandiford  <rsandifo@nildram.co.uk>
+
+	* config/mips/mips.md (*clear_upper32): Use "W" as the memory operand.
+
+2007-09-17  Chao-ying Fu  <fu@mips.com>
+	    Nigel Stephens  <nigel@mips.com>
+
+	* config/fixed-bit.h: New file.
+	* config/fixed-bit.c: New file.
+	* doc/libgcc.texi (Fixed-point fractional library routines): New node.
+
+2007-09-18  Jakub Jelinek  <jakub@redhat.com>
+
+	* c-format.h (format_kind_info): Add alloc_char field.
+	* c-format.c (scanf_flag_specs): Add 'm'.
+	(scanf_flag_pairs): Add 'a', 'm' pair.
+	(scan_char_table): Allow 'm' modifier for c, s, [, C and S.
+	(format_types_orig): Add alloc_char fields.
+	(check_format_info_main): Rename aflag to alloc_flag.
+	Handle fki->alloc_char. modifier after width and before length
+	modifiers.  Move FMT_FLAG_SCANF_A_KLUDGE handling before
+	length modifiers as well.
+	* config/sol2-c.c (solaris_format_types): Add alloc_char field.
+
+	PR middle-end/33423
+	* builtins.c (expand_builtin_memory_chk): Handle COMPOUND_EXPRs
+	returned by build_call_expr.
+
+2007-09-17  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* tree-sra.c (maybe_lookup_element_for_expr) <COMPONENT_REF>: Return
+	NULL for variable-sized records too.
+	(sra_walk_expr) <COMPONENT_REF>: Stop at variable-sized records too.
+
+2007-09-17  Tom Tromey  <tromey@redhat.com>
+
+	* c-decl.c (pushdecl): Don't set DECL_LANG_SPECIFIC.
+	(c_builtin_function): Likewise.
+	(grokdeclarator): Likewise.
+
+2007-09-17  Zdenek Dvorak  <ook@ucw.cz>
+
+	PR rtl-optimization/26449
+	* loop-invariant.c (move_invariant_reg): Do not use force_operand.
+	(seq_insns_valid_p): Removed.
+
 2007-09-17  Eric Botcazou  <ebotcazou@adacore.com>
 
 	* tree-nomudflap.c (gate_mudflap): New static function.


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]