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 in some cases!
- From: gcctest at suse dot de
- To: jh at suse dot cz, gcc-regression at gcc dot gnu dot org
- Date: Fri, 07 Sep 2007 23:49:23 +0000
- Subject: A recent patch increased GCC's memory consumption in some cases!
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: 7023k -> 7025k
Peak memory use before GGC: 1156k
Peak memory use after GGC: 1061k
Maximum of released memory in single GGC run: 122k
Garbage: 239k
Leak: 1077k
Overhead: 147k
GGC runs: 4
comparing empty function compilation at -O0 -g level:
Overall memory needed: 7039k -> 7041k
Peak memory use before GGC: 1184k
Peak memory use after GGC: 1089k
Maximum of released memory in single GGC run: 123k
Garbage: 242k
Leak: 1109k
Overhead: 152k
GGC runs: 4
comparing empty function compilation at -O1 level:
Overall memory needed: 7079k -> 7081k
Peak memory use before GGC: 1156k
Peak memory use after GGC: 1053k
Maximum of released memory in single GGC run: 116k
Garbage: 241k
Leak: 1078k
Overhead: 148k
GGC runs: 3
comparing empty function compilation at -O2 level:
Overall memory needed: 7099k -> 7101k
Peak memory use before GGC: 1157k
Peak memory use after GGC: 1054k
Maximum of released memory in single GGC run: 117k
Garbage: 245k
Leak: 1079k
Overhead: 148k
GGC runs: 3
comparing empty function compilation at -O3 level:
Overall memory needed: 7099k -> 7101k
Peak memory use before GGC: 1157k
Peak memory use after GGC: 1054k
Maximum of released memory in single GGC run: 117k
Garbage: 245k
Leak: 1079k
Overhead: 148k
GGC runs: 3
comparing combine.c compilation at -O0 level:
Overall memory needed: 22047k -> 22049k
Peak memory use before GGC: 8292k
Peak memory use after GGC: 7631k
Maximum of released memory in single GGC run: 1581k
Garbage: 38803k
Leak: 6197k
Overhead: 5051k
GGC runs: 371
comparing combine.c compilation at -O0 -g level:
Overall memory needed: 24055k -> 24057k
Peak memory use before GGC: 10122k
Peak memory use after GGC: 9396k
Maximum of released memory in single GGC run: 1875k
Garbage: 39152k
Leak: 9036k
Overhead: 5723k
GGC runs: 344
comparing combine.c compilation at -O1 level:
Overall memory needed: 33135k -> 33137k
Peak memory use before GGC: 17037k
Peak memory use after GGC: 16838k
Maximum of released memory in single GGC run: 1379k
Garbage: 52335k
Leak: 6356k
Overhead: 6016k
GGC runs: 440
comparing combine.c compilation at -O2 level:
Overall memory needed: 35383k -> 35389k
Peak memory use before GGC: 17145k -> 17144k
Peak memory use after GGC: 16975k -> 16973k
Maximum of released memory in single GGC run: 1334k -> 1335k
Garbage: 71218k -> 71219k
Leak: 6674k
Overhead: 8271k -> 8271k
GGC runs: 507
comparing combine.c compilation at -O3 level:
Amount of memory still referenced at the end of compilation increased from 6785k to 6792k, overall 0.11%
Overall memory needed: 39907k -> 39909k
Peak memory use before GGC: 17379k -> 17377k
Peak memory use after GGC: 17029k -> 17027k
Maximum of released memory in single GGC run: 2131k
Garbage: 92528k -> 92529k
Leak: 6785k -> 6792k
Overhead: 10696k -> 10697k
GGC runs: 538 -> 539
comparing insn-attrtab.c compilation at -O0 level:
Overall memory needed: 138495k -> 138493k
Peak memory use before GGC: 58645k
Peak memory use after GGC: 32139k
Maximum of released memory in single GGC run: 34143k
Garbage: 131577k
Leak: 8939k
Overhead: 14855k
GGC runs: 296
comparing insn-attrtab.c compilation at -O0 -g level:
Overall memory needed: 139751k -> 139753k
Peak memory use before GGC: 59795k
Peak memory use after GGC: 33288k
Maximum of released memory in single GGC run: 34144k
Garbage: 131805k
Leak: 10615k
Overhead: 15236k
GGC runs: 290
comparing insn-attrtab.c compilation at -O1 level:
Overall memory needed: 149595k -> 149589k
Peak memory use before GGC: 57143k
Peak memory use after GGC: 50913k
Maximum of released memory in single GGC run: 24232k
Garbage: 212473k
Leak: 9831k
Overhead: 24859k
GGC runs: 320
comparing insn-attrtab.c compilation at -O2 level:
Overall memory needed: 187379k -> 187377k
Peak memory use before GGC: 57777k
Peak memory use after GGC: 52506k
Maximum of released memory in single GGC run: 22944k
Garbage: 253708k
Leak: 10919k
Overhead: 30573k
GGC runs: 350
comparing insn-attrtab.c compilation at -O3 level:
Overall memory needed: 194395k -> 194397k
Peak memory use before GGC: 69770k
Peak memory use after GGC: 63203k
Maximum of released memory in single GGC run: 23329k
Garbage: 280470k
Leak: 10924k
Overhead: 32339k
GGC runs: 350
comparing Gerald's testcase PR8361 compilation at -O0 level:
Overall memory needed: 155164k -> 155200k
Peak memory use before GGC: 89693k
Peak memory use after GGC: 88800k
Maximum of released memory in single GGC run: 18062k
Garbage: 210298k
Leak: 52988k
Overhead: 26476k
GGC runs: 418
comparing Gerald's testcase PR8361 compilation at -O0 -g level:
Overall memory needed: 175460k
Peak memory use before GGC: 101997k
Peak memory use after GGC: 100987k
Maximum of released memory in single GGC run: 18268k
Garbage: 216154k
Leak: 75856k
Overhead: 32156k
GGC runs: 386
comparing Gerald's testcase PR8361 compilation at -O1 level:
Ovarall memory allocated via mmap and sbrk decreased from 131656k to 121616k, overall -8.26%
Peak amount of GGC memory allocated before garbage collecting run decreased from 91716k to 88593k, overall -3.53%
Peak amount of GGC memory still allocated after garbage collecting decreased from 90805k to 87715k, overall -3.52%
Amount of produced GGC garbage decreased from 316942k to 296452k, overall -6.91%
Overall memory needed: 131656k -> 121616k
Peak memory use before GGC: 91716k -> 88593k
Peak memory use after GGC: 90805k -> 87715k
Maximum of released memory in single GGC run: 17317k -> 17330k
Garbage: 316942k -> 296452k
Leak: 52883k -> 52239k
Overhead: 32112k -> 30692k
GGC runs: 524 -> 515
comparing Gerald's testcase PR8361 compilation at -O2 level:
Ovarall memory allocated via mmap and sbrk decreased from 138772k to 127160k, overall -9.13%
Peak amount of GGC memory allocated before garbage collecting run decreased from 91995k to 88772k, overall -3.63%
Peak amount of GGC memory still allocated after garbage collecting decreased from 91052k to 87885k, overall -3.60%
Amount of produced GGC garbage decreased from 382475k to 363161k, overall -5.32%
Overall memory needed: 138772k -> 127160k
Peak memory use before GGC: 91995k -> 88772k
Peak memory use after GGC: 91052k -> 87885k
Maximum of released memory in single GGC run: 17300k -> 17312k
Garbage: 382475k -> 363161k
Leak: 54106k -> 53321k
Overhead: 38980k -> 37858k
GGC runs: 589 -> 590
comparing Gerald's testcase PR8361 compilation at -O3 level:
Ovarall memory allocated via mmap and sbrk decreased from 143100k to 131136k, overall -9.12%
Peak amount of GGC memory allocated before garbage collecting run decreased from 92913k to 89878k, overall -3.38%
Peak amount of GGC memory still allocated after garbage collecting decreased from 91940k to 88984k, overall -3.32%
Amount of produced GGC garbage decreased from 413019k to 390101k, overall -5.87%
Overall memory needed: 143100k -> 131136k
Peak memory use before GGC: 92913k -> 89878k
Peak memory use after GGC: 91940k -> 88984k
Maximum of released memory in single GGC run: 17669k -> 17671k
Garbage: 413019k -> 390101k
Leak: 54467k -> 53569k
Overhead: 41693k -> 40245k
GGC runs: 610 -> 609
comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
Overall memory needed: 379363k -> 379367k
Peak memory use before GGC: 101487k
Peak memory use after GGC: 57140k
Maximum of released memory in single GGC run: 50583k
Garbage: 179439k
Leak: 6289k
Overhead: 30886k
GGC runs: 107
comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
Overall memory needed: 380179k
Peak memory use before GGC: 102120k
Peak memory use after GGC: 57774k
Maximum of released memory in single GGC run: 50582k
Garbage: 179527k
Leak: 7997k
Overhead: 31352k
GGC runs: 110
comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
Overall memory needed: 294143k -> 294141k
Peak memory use before GGC: 80800k
Peak memory use after GGC: 73181k
Maximum of released memory in single GGC run: 40023k
Garbage: 235769k
Leak: 15627k
Overhead: 31950k
GGC runs: 105
comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
Overall memory needed: 270043k -> 270145k
Peak memory use before GGC: 78168k
Peak memory use after GGC: 73182k
Maximum of released memory in single GGC run: 33750k
Garbage: 245807k
Leak: 15716k
Overhead: 34175k
GGC runs: 118
comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
Overall memory needed: 1017623k -> 1017621k
Peak memory use before GGC: 166810k
Peak memory use after GGC: 156373k
Maximum of released memory in single GGC run: 83494k
Garbage: 356756k
Leak: 25859k
Overhead: 46146k
GGC runs: 99
Head of the ChangeLog is:
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog 2007-09-07 05:16:17.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog 2007-09-07 21:56:22.000000000 +0000
@@ -1,3 +1,178 @@
+2007-09-07 Richard Guenther <rguenther@suse.de>
+
+ Reapply
+ 2007-09-06 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/32586
+ * tree-ssa-sccvn.c (simplify_binary_expression): Avoid
+ folding if nothing changed.
+ (simplify_unary_expression): New function. Do tree combining
+ on conversion like codes.
+ (try_to_simplify): Call it.
+
+2007-09-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR target/33286
+ * gthr-posix.h (__gthread_active_p): Add implementation for hppa-hpux.
+ (__gthread_active,__gthread_start, __gthread_active_init): New.
+ * gthr-posix95.h: Likewise.
+
+2007-09-07 Roman Zippel <zippel@linux-m68k.org>
+
+ * function.h (struct function): Rename calls_unwind_init
+ to saves_all_registers.
+ (current_function_saves_all_registers): Renamed from
+ current_function_calls_unwind_init.
+ * reload1.c (reload): Set current_function_saves_all_registers.
+ * except.c (expand_builtin_unwind_init): Likewise.
+ * config/m68k/m68k.c (m68k_save_reg): Use
+ current_function_saves_all_registers to save pic register.
+
+2007-09-07 Janis Johnson <janis187@us.ibm.com>
+
+ config/m68k/m68k.c (floating_exact_log2): Update call to real_2expN.
+ config/s390/s390.md (fixuns_trunc<BFP:mode><GPR:mode>2): Ditto.
+
+ Reapply reverted changes:
+
+ 2007-09-06 Jan Hubicka <jh@suse.cz>
+
+ * config/i386.c (ix86_expand_lround, ix86_expand_round): Update call of
+ real_2expN.
+
+ 2007-09-06 Richard Sandiford <richard@codesourcery.com>
+
+ * config/mips/mips.md (fixuns_truncdfsi2, fixuns_truncdfdi2)
+ (fixuns_truncsfsi2, fixuns_truncsfdi2): Update calls to real_2expN.
+
+ 2007-09-05 Janis Johnson <janis187@us.ibm.com>
+
+ * optabs.c (expand_float): Convert unsigned integer as signed only
+ if it provides sufficient accuracy; add mode argument to real_2expN.
+ (expand_fix): Fix comment typos; extend binary float into mode
+ wider than destination for converion to unsigned integer; add mode
+ argument to real_2expN.
+ * real.c (real_2expN): Add mode argument to special-case decimal
+ float values.
+ * real.h (real_2expN): Ditto.
+ * fixed-value.c (check_real_for_fixed_mode): Add mode argument to
+ real_2expN.
+ (fixed_from_string): Ditto.
+ (fixed_to_decimal): Ditto.
+ (fixed_convert_from_real): Ditto.
+ (real_convert_from_fixed): Ditto.
+ * config/rs6000/rs6000.md (FP): Include DD and TD modes.
+ * config/rs6000/dfp.md (extendddtd2, adddd3, addtd3, subdd3, subtd3,
+ muldd3, multd3, divdd3, divtd3, cmpdd_internal1, cmptd_internal1,
+ floatditd2, ftruncdd2, fixdddi2, ftrunctd2, fixddi2): New.
+
+2007-09-07 Diego Novillo <dnovillo@google.com>
+
+ * tree-flow.h (const_block_stmt_iterator): Remove.
+ Update all users to use block_stmt_iterator.
+ * tree-iterator.h (const_tree_stmt_iterator): Remove.
+ Update all users to use tree_stmt_iterator.
+
+2007-09-07 Sandra Loosemore <sandra@codesourcery.com>
+
+ * config/mips/mips.c (mips_set_current_function): Temporarily
+ make this a no-op to fix bootstrap errors, pending rewrite.
+
+2007-09-07 Jan Hubicka <jh@suse.cz>
+
+ * reorg.c (dbr_schedule): Move code removing placeholder USEs later
+ in the pass.
+
+2007-09-07 Dorit Nuzman <dorit@il.ibm.com>
+
+ PR tree-optimization/33299
+ * tree-vect-transform.c (vect_create_epilog_for_reduction): Update uses
+ for all relevant loop-exit phis, not just the first.
+
+2007-09-07 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/33330
+ * tree-ssa-operands.c (access_can_touch_variable): An access
+ of the form (*p)[0] can touch a variable of same size.
+
+2007-09-07 Jan Hubicka <jh@suse.cz>
+
+ * passes.c (init_optimization_passes): Add simple dce and addressable
+ passes.
+ * tree-ssa.c (execute_update_addresses_taken): New function.
+ (pass_update_address_taken): New.
+ * tree-ssa-dse.c (execute_simple_dse): New function.
+ (pass_simple_dse): New.
+ * tree-pass.h (pass_simple_dse, pass_update_address_taken): Declare.
+
+2007-09-07 Tobias Burnus <burnus@net-b.de>
+
+ PR middle-end/33321
+ * doc/invoke.texi: Fix -Wstrict-overflow= table.
+
+2007-09-07 Richard Guenther <rguenther@suse.de>
+
+ Revert
+ 2007-09-06 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/32586
+ * tree-ssa-sccvn.c (simplify_binary_expression): Avoid
+ folding if nothing changed.
+ (simplify_unary_expression): New function. Do tree combining
+ on conversion like codes.
+ (try_to_simplify): Call it.
+
+2007-09-07 Richard Guenther <rguenther@suse.de>
+ Uros Bizjak <ubizjak@gmail.com>
+
+ PR tree-optimization/32821
+ * tree_if_conv.c (combine_blocks): Use alloc_stmt_list instead of
+ NULL in the call to set_bb_stmt_list.
+
+2007-09-07 Richard Sandiford <richard@codesourcery.com>
+
+ * config/mips/mips.c (build_mips16_call_stub): Emit all direct
+ float calls here, rather than leaving some to the caller.
+ Use call_internal_direct and call_value_internal_direct.
+ * config/mips/mips.md (call_internal_direct): New pattern.
+ (call_value_internal_direct): Likewise.
+
+2007-09-07 Richard Sandiford <richard@codesourcery.com>
+
+ * config/mips/mips.c (mips_base_move_loop_invariants): New variable.
+ (mips_set_mips16_mode): Restore flag_move_loop_invariants, then set
+ to 0 for MIPS16.
+ (override_options): Set mips_base_move_loop_invariants.
+
+2007-09-07 Richard Sandiford <richard@codesourcery.com>
+
+ * config/mips/mips.opt (mcode-readable=): Move to keep list
+ alphabetical.
+
+2007-09-07 Richard Sandiford <richard@codesourcery.com>
+
+ * doc/invoke.texi: Document the MIPS -mlocal-sdata, -mextern-sdata
+ and -mgpopt options. Adjust the -G documentation to match.
+ * config/mips/mips.opt (mextern-data, mgpopt, mlocal-data): New.
+ * config/mips/mips.c (mips_rtx_constant_in_small_data_p): New
+ function, split out from mips_classify_symbol. Return false for
+ !TARGET_LOCAL_SDATA.
+ (mips_classify_symbol): Call mips_rtx_constant_in_small_data_p.
+ Only use GP-relative accesses for non-pool symbols if TARGET_GPOPT.
+ (override_options): Check whether the -mgpopt setting is consistent
+ with the other flags.
+ (symbolic_expression_p): Delete.
+ (mips_select_rtx_section): Use mips_rtx_constant_in_small_data_p
+ and default_elf_select_rtx_section.
+ (mips_in_small_data_p): Honor section attributes for MIPS16 too.
+ Return false for local data unless TARGET_LOCAL_SDATA. Likewise
+ external data and TARGET_EXTERN_SDATA.
+
+2007-09-07 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/33303
+ * doc/cpp.texi (Common Predefined Macros): Add __GFORTRAN__.
+
2007-09-05 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* regrename.c (copyprop_hardreg_forward_1): New variable next. Use
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.