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!
- From: gcctest at suse dot de
- To: jh at suse dot cz, gcc-regression at gcc dot gnu dot org
- Date: Fri, 13 Apr 2007 11:40:29 +0000
- Subject: 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: 7387k -> 7389k
Peak memory use before GGC: 2263k
Peak memory use after GGC: 1952k
Maximum of released memory in single GGC run: 311k
Garbage: 446k
Leak: 2285k
Overhead: 456k
GGC runs: 3
comparing empty function compilation at -O0 -g level:
Overall memory needed: 7403k -> 7405k
Peak memory use before GGC: 2290k
Peak memory use after GGC: 1979k
Maximum of released memory in single GGC run: 311k
Garbage: 449k
Leak: 2318k
Overhead: 461k
GGC runs: 3
comparing empty function compilation at -O1 level:
Overall memory needed: 7519k -> 7517k
Peak memory use before GGC: 2263k
Peak memory use after GGC: 1952k
Maximum of released memory in single GGC run: 311k
Garbage: 452k
Leak: 2288k
Overhead: 457k
GGC runs: 4
comparing empty function compilation at -O2 level:
Overall memory needed: 7527k -> 7525k
Peak memory use before GGC: 2263k
Peak memory use after GGC: 1952k
Maximum of released memory in single GGC run: 311k
Garbage: 455k
Leak: 2288k
Overhead: 457k
GGC runs: 4
comparing empty function compilation at -O3 level:
Overall memory needed: 7527k -> 7525k
Peak memory use before GGC: 2263k
Peak memory use after GGC: 1952k
Maximum of released memory in single GGC run: 311k
Garbage: 455k
Leak: 2288k
Overhead: 457k
GGC runs: 4
comparing combine.c compilation at -O0 level:
Overall memory needed: 17731k -> 17729k
Peak memory use before GGC: 9264k
Peak memory use after GGC: 8852k
Maximum of released memory in single GGC run: 2577k
Garbage: 37096k
Leak: 6580k
Overhead: 5053k
GGC runs: 282
comparing combine.c compilation at -O0 -g level:
Overall memory needed: 19887k -> 19889k
Peak memory use before GGC: 10880k
Peak memory use after GGC: 10512k
Maximum of released memory in single GGC run: 2351k
Garbage: 37693k
Leak: 9465k
Overhead: 5759k
GGC runs: 270
comparing combine.c compilation at -O1 level:
Overall memory needed: 35563k -> 35561k
Peak memory use before GGC: 19348k
Peak memory use after GGC: 19155k
Maximum of released memory in single GGC run: 2272k
Garbage: 51578k
Leak: 6615k
Overhead: 6003k
GGC runs: 348
comparing combine.c compilation at -O2 level:
Overall memory needed: 39971k -> 39969k
Peak memory use before GGC: 19415k
Peak memory use after GGC: 19213k
Maximum of released memory in single GGC run: 2200k -> 2199k
Garbage: 67686k -> 67731k
Leak: 6729k -> 6729k
Overhead: 8047k -> 8041k
GGC runs: 401 -> 400
comparing combine.c compilation at -O3 level:
Amount of produced GGC garbage increased from 92701k to 92825k, overall 0.13%
Overall memory needed: 44215k -> 44261k
Peak memory use before GGC: 19713k
Peak memory use after GGC: 19380k
Maximum of released memory in single GGC run: 3715k -> 3714k
Garbage: 92701k -> 92825k
Leak: 6836k -> 6829k
Overhead: 11381k -> 11379k
GGC runs: 426
comparing insn-attrtab.c compilation at -O0 level:
Overall memory needed: 102855k -> 102845k
Peak memory use before GGC: 68627k
Peak memory use after GGC: 44730k
Maximum of released memory in single GGC run: 36429k
Garbage: 130923k
Leak: 9583k
Overhead: 16927k
GGC runs: 212
comparing insn-attrtab.c compilation at -O0 -g level:
Overall memory needed: 104355k -> 104357k
Peak memory use before GGC: 69788k
Peak memory use after GGC: 45998k
Maximum of released memory in single GGC run: 36429k
Garbage: 132399k
Leak: 11067k
Overhead: 17324k
GGC runs: 210
comparing insn-attrtab.c compilation at -O1 level:
Overall memory needed: 124791k -> 124809k
Peak memory use before GGC: 73426k
Peak memory use after GGC: 69350k
Maximum of released memory in single GGC run: 32798k
Garbage: 227633k
Leak: 9405k
Overhead: 27090k
GGC runs: 226
comparing insn-attrtab.c compilation at -O2 level:
Amount of produced GGC garbage increased from 262915k to 263316k, overall 0.15%
Overall memory needed: 195507k -> 195493k
Peak memory use before GGC: 74717k
Peak memory use after GGC: 69433k
Maximum of released memory in single GGC run: 29994k
Garbage: 262915k -> 263316k
Leak: 9402k
Overhead: 32709k -> 32730k
GGC runs: 245
comparing insn-attrtab.c compilation at -O3 level:
Amount of produced GGC garbage increased from 291982k to 292402k, overall 0.14%
Overall memory needed: 205003k -> 204801k
Peak memory use before GGC: 84750k
Peak memory use after GGC: 78009k
Maximum of released memory in single GGC run: 30928k
Garbage: 291982k -> 292402k
Leak: 9406k -> 9406k
Overhead: 33442k -> 33468k
GGC runs: 246
comparing Gerald's testcase PR8361 compilation at -O0 level:
Overall memory needed: 147063k -> 147073k
Peak memory use before GGC: 90233k
Peak memory use after GGC: 89339k
Maximum of released memory in single GGC run: 17774k
Garbage: 207964k
Leak: 49198k
Overhead: 23912k
GGC runs: 410
comparing Gerald's testcase PR8361 compilation at -O0 -g level:
Overall memory needed: 164839k -> 164845k
Peak memory use before GGC: 102839k
Peak memory use after GGC: 101821k
Maximum of released memory in single GGC run: 18128k
Garbage: 214471k
Leak: 72513k
Overhead: 29808k
GGC runs: 384
comparing Gerald's testcase PR8361 compilation at -O1 level:
Overall memory needed: 151355k -> 151353k
Peak memory use before GGC: 101914k
Peak memory use after GGC: 100904k
Maximum of released memory in single GGC run: 17235k
Garbage: 338436k
Leak: 50295k
Overhead: 29925k
GGC runs: 525
comparing Gerald's testcase PR8361 compilation at -O2 level:
Overall memory needed: 156831k -> 156825k
Peak memory use before GGC: 102520k -> 102521k
Peak memory use after GGC: 101504k
Maximum of released memory in single GGC run: 17232k
Garbage: 382732k -> 382642k
Leak: 51012k -> 51011k
Overhead: 35197k -> 35189k
GGC runs: 571 -> 572
comparing Gerald's testcase PR8361 compilation at -O3 level:
Overall memory needed: 159783k -> 159769k
Peak memory use before GGC: 104340k
Peak memory use after GGC: 103297k
Maximum of released memory in single GGC run: 17648k
Garbage: 412719k -> 412730k
Leak: 51296k -> 51296k
Overhead: 37525k -> 37519k
GGC runs: 587
comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
Overall memory needed: 244770k -> 244781k
Peak memory use before GGC: 80963k
Peak memory use after GGC: 58702k
Maximum of released memory in single GGC run: 44134k
Garbage: 142205k
Leak: 7613k
Overhead: 24559k
GGC runs: 79
comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
Overall memory needed: 245594k -> 245593k
Peak memory use before GGC: 81609k
Peak memory use after GGC: 59348k
Maximum of released memory in single GGC run: 44123k
Garbage: 142415k
Leak: 9381k
Overhead: 25054k
GGC runs: 89
comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
Overall memory needed: 253839k -> 253733k
Peak memory use before GGC: 84262k
Peak memory use after GGC: 74847k
Maximum of released memory in single GGC run: 36149k
Garbage: 221602k
Leak: 20856k
Overhead: 30442k
GGC runs: 81
comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
Overall memory needed: 507535k -> 507381k
Peak memory use before GGC: 79833k
Peak memory use after GGC: 74847k
Maximum of released memory in single GGC run: 33439k
Garbage: 228633k
Leak: 20946k
Overhead: 32524k
GGC runs: 91
comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
Overall memory needed: 1269191k -> 1269761k
Peak memory use before GGC: 201851k
Peak memory use after GGC: 190309k
Maximum of released memory in single GGC run: 80679k
Garbage: 370229k
Leak: 46312k
Overhead: 48626k
GGC runs: 70
Head of the ChangeLog is:
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog 2007-04-12 16:59:04.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog 2007-04-13 09:39:50.000000000 +0000
@@ -1,3 +1,194 @@
+2007-04-13 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/21258
+ * tree-vrp.c (compare_case_labels): New helper.
+ (find_switch_asserts): New function.
+ (find_assert_locations): Call it for SWITCH_EXPRs.
+
+2007-04-13 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.h (X87_FLOAT_MODE_P): Check for TARGET_80387.
+ * config/i386/i386.md (*cmpfp0): Remove check for TARGET_80387, this
+ check is now implied in X87_FLOAT_MODE_P.
+ (*cmpfp_u, *cmpfp_<mode>, *cmpfp_i_i387): Ditto.
+ (*cmpfp_iu_387, fix_trunc<mode>_fisttp_i386_1): Ditto.
+ (fix_trunc<mode>_i386_fisttp): Ditto.
+ (fix_trunc<mode>_i387_fisttp_with_temp): Ditto.
+ (*fix_trunc<mode>_i387_1, fix_truncdi_i387): Ditto.
+ (fix_truncdi_i387_with_temp, fix_trunc<mode>_i387): Ditto.
+ (fix_trunc<mode>_i387_with_temp, *fp_jcc_1_387): Ditto.
+ (*fp_jcc_2_387, *fp_jcc_5_387, *fp_jcc_6_387): Ditto.
+ (*fp_jcc_7_387, *fp_jcc_8<mode>_387): Ditto.
+ (unnamed_splitters): Ditto.
+ * config/i386/i386.c (function_value_32): Generate FIRST_FLOAT_REG
+ for X87_FLOAT_MODE_P mode. Override FIRST_FLOAT_REG with
+ FIRST_SSE_REG for local functions when SSE math is enabled or
+ for functions with sseregparm attribute.
+ (standard_80387_constant_p): Return -1 if mode is not
+ X87_FLOAT_MODE_P.
+ (ix86_cc_mode): Assert that scalar mode is not DECIMAL_FLOAT_MODE_P.
+ (ix86_expand_compare): Ditto.
+ (ix86_expand_carry_flag_compare): Ditto.
+ (ix86_expand_int_movcc): Check for SCALAR_FLOAT_MODE_P instead
+ of FLOAT_MODE_P for cmp_mode and assert that cmp_mode is not
+ DECIMAL_FLOAT_MODE_P.
+ (ix86_preferred_output_reload_class): Use X87_FLOAT_MODE_P instead
+ of SCALAR_FLOAT_MODE_P.
+ (ix86_rtx_costs) [PLUS] Remove FLOAT_MODE_P and fall through to ...
+ [MINUS]: ... here. Add SSE_FLOAT_MODE_P and X87_FLOAT_MODE_P
+ checks before FLOAT_MODE_P.
+ [MULT]: Add SSE_FLOAT_MODE_P and X87_FLOAT_MODE_P checks
+ before FLOAT_MODE_P.
+ [DIV]: Ditto.
+ [NEG]: Ditto.
+ [ABS]: Ditto.
+ [SQRT]: Ditto.
+ [FLOAT_EXTEND]: Use SSE_FLOAT_MODE_P.
+
+2007-04-12 Paolo Bonzini <bonzini@gnu.org>
+ Charles Wilson <libtool@cwilson.fastmail.fm>
+
+ * Makefile.in (stamp-as, stamp-collect-ld, stamp-nm): Remove.
+ (libgcc.mvars): Don't depend on them.
+ * configure.ac (as, collect-ld, nm): Create from exec-tool.in.
+ * exec-tool.in: New.
+
+2007-04-12 Brooks Moses <brooks.moses@codesourcery.com>
+
+ * doc/invoke.text (--help): Document --help=common.
+
+2007-04-12 Thomas Neumann <tneumann@users.sourceforge.net>
+
+ * stub-objc.c (objc_build_keyword_decl): Avoid C++ keywords.
+
+2007-04-12 Richard Sandiford <richard@codesourcery.com>
+
+ * Makefile.in (insn-emit.o): Depend on $(INTEGRATE_H).
+ * genemit.c (main): Emit #include "integrate.h".
+ * config/mips/mips-protos.h (SYMBOL_HALF): New mips_symbol_type.
+ (LOADGP_RTP): New mips_loadgp_style.
+ * config/mips/mips.h: Include config/vxworks-dummy.h.
+ (TARGET_RTP_PIC): New macro.
+ (TARGET_USE_GOT): Return true for TARGET_RTP_PIC.
+ (TARGET_USE_PIC_FN_ADDR_REG): Return true for TARGET_VXWORKS_RTP.
+ (ASM_OUTPUT_ADDR_DIFF_ELT): Emit function-relative case tables
+ for TARGET_RTP_PIC.
+ * config/mips/vxworks.h (SUBTARGET_ASM_SPEC): Define. Pass down
+ -mvxworks-pic when using -mrtp and a PIC option.
+ * config/mips/mips.c (mips_classify_symbol): Return SYMBOL_GOT_DISP
+ for RTP PIC.
+ (mips_symbolic_constant_p, mips_symbolic_address_p)
+ (mips_symbol_insns): Handle SYMBOL_HALF.
+ (override_options): Warn about -G and -mrtp being used together.
+ Initialize mips_lo_relocs[SYMBOL_HALF].
+ (mips_current_loadgp_style): Return LOADGP_RTP for RTP PIC.
+ (mips_emit_loadgp): Handle LOADGP_RTP.
+ (mips_in_small_data_p): Return false for TARGET_VXWORKS_RTP.
+ * config/mips/mips.md (loadgp_rtp): New insn and splitter.
+ (tablejump): Handle function-relative case table entries if
+ TARGET_RTP_PIC.
+ * config/mips/predicates.md (symbol_ref_operand): New predicate.
+
+2007-04-12 Richard Sandiford <richard@codesourcery.com>
+
+ * config/mips/mips.md (load_call<mode>): Allow any general register.
+ destination.
+ (sibcall_value_internal, sibcall_value_multiple_internal)
+ (call_value_internal, call_value_split, call_value_multiple_internal)
+ (call_value_multiple_split): Remove constraints from operand 0.
+
+2007-04-12 Richard Sandiford <richard@codesourcery.com>
+
+ * config/mips/mips-protos.h: In comments, refer to loadgp_absolute
+ rather than loadgp_noshared.
+ * config/mips/mips.c (mips_emit_loadgp): Use gen_loadgp_absolute
+ instead of gen_loadgp_noshared. Use gen_loadgp_newabi instead of
+ gen_loadgp.
+ * config/mips/mips.md (loadgp): Rename to...
+ (loadgp_newabi): ...this.
+ (loadgp_noshared): Rename to...
+ (loadgp_absolute): ...this.
+
+2007-04-12 Richard Sandiford <richard@codesourcery.com>
+
+ * config/mips/mips.c (mips_ok_for_lazy_binding_p): Always return
+ false for locally-binding symbols.
+ (mips_dangerous_for_la25_p): Check mips_global_symbol_p.
+
+2007-04-12 Richard Sandiford <richard@codesourcery.com>
+
+ * config/mips/mips-protos.h (SYMBOL_GOT_LOCAL): Rename to...
+ (SYMBOL_GOT_PAGE_OFST): ...this.
+ (SYMBOL_GOT_GLOBAL): Rename to...
+ (SYMBOL_GOT_DISP): ...this.
+ (SYMBOL_GOTOFF_GLOBAL): Rename to...
+ (SYMBOL_GOTOFF_DISP): ...this. Update comments accordingly.
+ * config/mips/mips.c (mips_global_symbol_p): New function.
+ (mips_symbol_binds_local_p): Likewise.
+ (mips_classify_symbol): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP
+ and SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST. Use mips_global_symbol_p
+ and mips_symbol_binds_local_p.
+ (mips_symbolic_constant_p, mips_symbolic_address_p, mips_symbol_insns)
+ (override_options): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP,
+ SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST and SYMBOL_GOTOFF_GLOBAL to
+ SYMBOL_GOTOFF_DISP.
+ (mips_ok_for_lazy_binding_p): New function.
+ (mips_load_call_address, mips_expand_call): Use it.
+ (mips_dangerous_for_la25_p): Likewise.
+ * config/mips/mips.md (*xgot_hi<mode>, *xgot_lo<mode>)
+ (*got_disp<mode>): Use got_disp_operand instead of
+ global_got_operand. Use SYMBOL_GOTOFF_DISP instead of
+ SYMBOL_GOTOFF_GLOBAL.
+ (*got_page<mode>): Use got_page_ofst_operand instead of
+ local_got_operand.
+ * config/mips/predicates.md (const_call_insn_operand): Use
+ SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL.
+ (global_got_operand): Rename to...
+ (got_disp_operand): ...this and use SYMBOL_GOT_DISP instead of
+ SYMBOL_GOT_GLOBAL.
+ (local_got_operand): Rename to...
+ (got_page_ofst_operand): ...this and use SYMBOL_GOT_PAGE_OFST instead
+ of SYMBOL_GOT_LOCAL.
+
+2007-04-12 Richard Sandiford <richard@codesourcery.com>
+
+ * config/mips/mips.h (TARGET_SPLIT_CALLS): Check
+ TARGET_CALL_CLOBBERED_GP.
+ (TARGET_SIBCALLS): Check TARGET_USE_GOT instead of TARGET_ABICALLS.
+ (TARGET_USE_GOT, TARGET_CALL_CLOBBERED_GP): New macros.
+ (TARGET_CALL_SAVED_GP, TARGET_USE_PIC_FN_ADDR_REG): Likewise.
+ (STARTING_FRAME_OFFSET): Check TARGET_CALL_CLOBBERED_GP instead
+ of TARGET_ABICALLS && !TARGET_NEWABI.
+ (MIPS_CALL): Check TARGET_USE_GOT instead of TARGET_ABICALLS.
+ * config/mips/mips.c (mips_load_call_address): Check
+ TARGET_CALL_SAVED_GP instead of TARGET_NEWABI.
+ (mips_global_pointer): Check TARGET_USE_GOT instead of TARGET_ABICALLS.
+ Check TARGET_CALL_SAVED_GP instead of TARGET_NEWABI.
+ (mips_save_reg_p): Check TARGET_CALL_SAVED_GP instead of
+ TARGET_ABICALLS && TARGET_NEWABI.
+ (mips_current_loadgp_style): Check TARGET_USE_GOT instead of
+ TARGET_ABICALLS.
+ (mips_expand_prologue): Check TARGET_OLDABI instead of !TARGET_NEWABI.
+ (mips_expand_epilogue): Check TARGET_CALL_SAVED_GP instead of
+ TARGET_ABICALLS && TARGET_NEWABI.
+ (mips_output_mi_thunk): Check TARGET_USE_GOT instead of
+ TARGET_ABICALLS. Check TARGET_CALL_SAVED_GP instead of
+ TARGET_NEWABI. Use TARGET_USE_PIC_FN_ADDR_REG to decide
+ whether indirect calls must use $25.
+ (mips_extra_live_on_entry): Check TARGET_GOT instead of
+ TARGET_ABICALLS.
+ * config/mips/mips.md (jal_macro): Check flag_pic and
+ TARGET_CALL_CLOBBERED_GP instead of TARGET_ABICALLS and TARGET_NEWABI.
+ (builtin_setjmp_setup, builtin_longjmp): Check TARGET_USE_GOT
+ instead of TARGET_ABICALLS.
+ (exception_receiver): Check TARGET_CALL_CLOBBERED_GP instead of
+ TARGET_ABICALLS && TARGET_OLDABI.
+ (load_call<mode>): Check TARGET_USE_GOT instead of TARGET_ABICALLS.
+ (sibcall): In the comment above the define_insn, mention
+ TARGET_USE_PIC_FN_ADDR_REG instead of TARGET_ABICALLS.
+ * config/mips/constraints.md (c): Check TARGET_USE_PIC_FN_ADDR_REG
+ instead of TARGET_ABICALLS.
+
2007-04-12 Bernd Schmidt <bernd.schmidt@analog.com>
* doc/md.texi (Blackfin family constraints): Document PA and PB.
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.