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, 24 Aug 2007 23:28:26 +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: 8331k
Peak memory use before GGC: 3396k
Peak memory use after GGC: 3043k
Maximum of released memory in single GGC run: 353k
Garbage: 525k
Leak: 3798k
Overhead: 915k
GGC runs: 3
comparing empty function compilation at -O0 -g level:
Overall memory needed: 8347k
Peak memory use before GGC: 3423k
Peak memory use after GGC: 3071k
Maximum of released memory in single GGC run: 352k
Garbage: 527k
Leak: 3831k
Overhead: 919k
GGC runs: 3
comparing empty function compilation at -O1 level:
Overall memory needed: 8387k
Peak memory use before GGC: 3396k
Peak memory use after GGC: 3043k
Maximum of released memory in single GGC run: 353k
Garbage: 527k
Leak: 3799k
Overhead: 915k
GGC runs: 3
comparing empty function compilation at -O2 level:
Overall memory needed: 8391k
Peak memory use before GGC: 3396k
Peak memory use after GGC: 3044k
Maximum of released memory in single GGC run: 352k
Garbage: 531k
Leak: 3800k
Overhead: 916k
GGC runs: 3
comparing empty function compilation at -O3 level:
Overall memory needed: 8391k
Peak memory use before GGC: 3396k
Peak memory use after GGC: 3044k
Maximum of released memory in single GGC run: 352k
Garbage: 531k
Leak: 3800k
Overhead: 916k
GGC runs: 3
comparing combine.c compilation at -O0 level:
Overall memory needed: 23755k
Peak memory use before GGC: 10323k
Peak memory use after GGC: 9567k
Maximum of released memory in single GGC run: 1903k
Garbage: 39069k -> 39067k
Leak: 8856k
Overhead: 5786k
GGC runs: 254
comparing combine.c compilation at -O0 -g level:
Overall memory needed: 25623k
Peak memory use before GGC: 11984k
Peak memory use after GGC: 11358k
Maximum of released memory in single GGC run: 1516k
Garbage: 39438k -> 39437k
Leak: 11749k
Overhead: 6492k -> 6492k
GGC runs: 250
comparing combine.c compilation at -O1 level:
Overall memory needed: 35735k
Peak memory use before GGC: 18984k
Peak memory use after GGC: 18794k
Maximum of released memory in single GGC run: 1375k
Garbage: 52590k -> 52588k
Leak: 8994k
Overhead: 6749k
GGC runs: 321
comparing combine.c compilation at -O2 level:
Overall memory needed: 37755k -> 37751k
Peak memory use before GGC: 19038k
Peak memory use after GGC: 18848k
Maximum of released memory in single GGC run: 1410k
Garbage: 70992k -> 70990k
Leak: 9322k
Overhead: 8864k -> 8864k
GGC runs: 383
comparing combine.c compilation at -O3 level:
Overall memory needed: 40559k
Peak memory use before GGC: 19313k
Peak memory use after GGC: 18965k
Maximum of released memory in single GGC run: 2261k
Garbage: 92923k -> 92929k
Leak: 9434k
Overhead: 11492k -> 11492k
GGC runs: 412
comparing insn-attrtab.c compilation at -O0 level:
Overall memory needed: 140099k -> 140103k
Peak memory use before GGC: 60580k
Peak memory use after GGC: 34074k
Maximum of released memory in single GGC run: 34143k
Garbage: 132016k
Leak: 11586k
Overhead: 15589k
GGC runs: 197
comparing insn-attrtab.c compilation at -O0 -g level:
Overall memory needed: 141359k -> 141355k
Peak memory use before GGC: 61742k
Peak memory use after GGC: 35235k
Maximum of released memory in single GGC run: 34144k
Garbage: 132500k
Leak: 13040k
Overhead: 15986k
GGC runs: 199
comparing insn-attrtab.c compilation at -O1 level:
Overall memory needed: 150223k
Peak memory use before GGC: 59101k
Peak memory use after GGC: 52850k
Maximum of released memory in single GGC run: 24232k
Garbage: 212962k
Leak: 12480k
Overhead: 25582k
GGC runs: 222
comparing insn-attrtab.c compilation at -O2 level:
Overall memory needed: 188899k -> 188903k
Peak memory use before GGC: 59723k
Peak memory use after GGC: 54429k
Maximum of released memory in single GGC run: 22887k
Garbage: 254073k
Leak: 13562k
Overhead: 31305k
GGC runs: 249
comparing insn-attrtab.c compilation at -O3 level:
Overall memory needed: 195879k
Peak memory use before GGC: 71708k
Peak memory use after GGC: 65141k
Maximum of released memory in single GGC run: 23330k
Garbage: 281238k
Leak: 13573k
Overhead: 33104k
GGC runs: 252
comparing Gerald's testcase PR8361 compilation at -O0 level:
Overall memory needed: 156541k -> 156557k
Peak memory use before GGC: 91628k -> 91630k
Peak memory use after GGC: 90711k -> 90713k
Maximum of released memory in single GGC run: 17988k
Garbage: 210869k -> 211045k
Leak: 55684k -> 55684k
Overhead: 27053k -> 27259k
GGC runs: 397
comparing Gerald's testcase PR8361 compilation at -O0 -g level:
Overall memory needed: 177757k -> 177765k
Peak memory use before GGC: 104596k -> 104598k
Peak memory use after GGC: 103552k -> 103554k
Maximum of released memory in single GGC run: 18703k
Garbage: 216721k -> 216895k
Leak: 79113k -> 79113k
Overhead: 33021k -> 33227k
GGC runs: 373
comparing Gerald's testcase PR8361 compilation at -O1 level:
Peak amount of GGC memory allocated before garbage collecting increased from 96157k to 96351k, overall 0.20%
Peak amount of GGC memory still allocated after garbage collecting increased from 95203k to 95396k, overall 0.20%
Amount of produced GGC garbage increased from 319652k to 320051k, overall 0.12%
Overall memory needed: 135247k -> 135455k
Peak memory use before GGC: 96157k -> 96351k
Peak memory use after GGC: 95203k -> 95396k
Maximum of released memory in single GGC run: 17368k
Garbage: 319652k -> 320051k
Leak: 55783k -> 55777k
Overhead: 33223k -> 33473k
GGC runs: 497
comparing Gerald's testcase PR8361 compilation at -O2 level:
Amount of produced GGC garbage increased from 379133k to 379778k, overall 0.17%
Overall memory needed: 145011k -> 145331k
Peak memory use before GGC: 96091k -> 96182k
Peak memory use after GGC: 95139k -> 95229k
Maximum of released memory in single GGC run: 17371k -> 17372k
Garbage: 379133k -> 379778k
Leak: 57027k -> 57068k
Overhead: 39586k -> 39879k
GGC runs: 561 -> 560
comparing Gerald's testcase PR8361 compilation at -O3 level:
Peak amount of GGC memory allocated before garbage collecting increased from 97701k to 97906k, overall 0.21%
Peak amount of GGC memory still allocated after garbage collecting increased from 96616k to 96822k, overall 0.21%
Overall memory needed: 148651k -> 149039k
Peak memory use before GGC: 97701k -> 97906k
Peak memory use after GGC: 96616k -> 96822k
Maximum of released memory in single GGC run: 17787k
Garbage: 417863k -> 418045k
Leak: 57338k -> 57369k
Overhead: 42927k -> 43180k
GGC runs: 584 -> 583
comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
Overall memory needed: 381016k
Peak memory use before GGC: 103476k
Peak memory use after GGC: 59130k
Maximum of released memory in single GGC run: 50582k
Garbage: 179674k
Leak: 9010k
Overhead: 31654k
GGC runs: 65
comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
Overall memory needed: 381836k
Peak memory use before GGC: 104123k
Peak memory use after GGC: 59776k
Maximum of released memory in single GGC run: 50583k
Garbage: 179827k
Leak: 10778k
Overhead: 32150k
GGC runs: 72
comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
Overall memory needed: 289827k -> 290227k
Peak memory use before GGC: 82784k
Peak memory use after GGC: 75172k
Maximum of released memory in single GGC run: 40017k
Garbage: 236071k
Leak: 18348k
Overhead: 32719k
GGC runs: 69
comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
Overall memory needed: 279363k -> 279443k
Peak memory use before GGC: 80159k
Peak memory use after GGC: 75173k
Maximum of released memory in single GGC run: 33750k
Garbage: 246134k
Leak: 18437k
Overhead: 34945k
GGC runs: 82
comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
Overall memory needed: 1012403k -> 1012335k
Peak memory use before GGC: 168800k
Peak memory use after GGC: 158364k
Maximum of released memory in single GGC run: 83495k
Garbage: 356480k
Leak: 28512k
Overhead: 46899k
GGC runs: 65
Head of the ChangeLog is:
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog 2007-08-24 05:45:36.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog 2007-08-24 21:37:36.000000000 +0000
@@ -1,3 +1,205 @@
+2007-08-24 Tom Tromey <tromey@redhat.com>
+
+ * varpool.c (varpool_last_needed_node): Fix comment typo.
+ * c-decl.c (duplicate_decls): Fix comment typo.
+ (clone_underlying_type): Update comment.
+
+2007-08-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * config/alpha/alpha.c (alpha_mangle_type, decl_has_samegp,
+ alpha_in_small_data_p, alpha_split_complex_arg,
+ alpha_stdarg_optimize_hook, TARGET_ASM_CAN_OUTPUT_MI_THUNK):
+ Constify.
+ * config/arm/arm-protos.h (arm_mangle_type): Likewise.
+ * config/arm/arm.c (arm_comp_type_attributes, arm_mangle_type):
+ Likewise.
+ * config/bfin/bfin.c (funkind, bfin_comp_type_attributes,
+ TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise.
+ * config/darwin-protos.h (darwin_binds_local_p): Likewise.
+ * config/darwin.c (darwin_binds_local_p): Likewise.
+ * config/frv/frv.c (frv_string_begins_with, frv_in_small_data_p):
+ Likewise.
+ * config/i386/i386-protos.h (i386_pe_binds_local_p,
+ i386_pe_valid_dllimport_attribute_p): Likewise.
+ * config/i386/i386.c (ix86_function_regparm,
+ ix86_comp_type_attributes, ix86_ms_bitfield_layout_p,
+ x86_can_output_mi_thunk, ix86_mangle_type,
+ TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise.
+ * config/i386/winnt.c (i386_pe_valid_dllimport_attribute_p,
+ i386_pe_binds_local_p): Likewise.
+ * config/ia64/ia64.c
+ (ia64_first_cycle_multipass_dfa_lookahead_guard_spec,
+ ia64_needs_block_p, ia64_in_small_data_p, ia64_mangle_type,
+ ia64_invalid_conversion, ia64_invalid_unary_op,
+ ia64_invalid_binary_op, TARGET_ASM_CAN_OUTPUT_MI_THUNK):
+ Likewise.
+ * config/m32c/m32c.c (m32c_comp_type_attributes): Likewise.
+ * config/m32r/m32r.c (m32r_in_small_data_p): Likewise.
+ * config/m68k/m68k.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise.
+ * config/mips/mips.c (mips_use_blocks_for_constant_p,
+ mips_in_small_data_p, mips_use_anchors_for_symbol_p,
+ mips_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK,
+ mips_near_type_p, mips_far_type_p, mips_global_symbol_p,
+ mips_symbol_binds_local_p, mips_classify_symbol): Likewise.
+ * config/pa/pa.c (pa_commutative_p): Likewise.
+ * config/rs6000/rs6000-protos.h (rs6000_elf_in_small_data_p):
+ Likewise.
+ * config/rs6000/rs6000.c (rs6000_invalid_within_doloop,
+ rs6000_ms_bitfield_layout_p, rs6000_mangle_type,
+ rs6000_use_blocks_for_constant_p,
+ rs6000_vector_alignment_reachable, rs6000_is_opaque_type,
+ invalid_arg_for_unprototyped_fn, TARGET_ASM_CAN_OUTPUT_MI_THUNK,
+ TARGET_SPLIT_COMPLEX_ARG, rs6000_elf_in_small_data_p): Likewise.
+ * config/s390/s390.c (s390_mangle_type,
+ TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_INVALID_WITHIN_DOLOOP):
+ Likewise.
+ * config/score/score.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK,
+ th_in_small_data_p): Likewise.
+ * config/sh/sh.c (sh_ms_bitfield_layout_p,
+ sh_dwarf_calling_convention, TARGET_ASM_CAN_OUTPUT_MI_THUNK):
+ Likewise.
+ * config/sparc/sparc.c (sparc_can_output_mi_thunk,
+ sparc_mangle_type): Likewise.
+ * config/spu/spu.c (spu_vector_alignment_reachable): Likewise.
+ * config/xtensa/xtensa.c (TARGET_SPLIT_COMPLEX_ARG): Likewise.
+ * emit-rtl.c (const_fixed_htab_hash, const_fixed_htab_eq):
+ Likewise.
+ * hooks.c (hook_bool_mode_const_rtx_false,
+ hook_bool_mode_const_rtx_true,
+ hook_bool_const_tree_hwi_hwi_const_tree_false,
+ hook_bool_const_tree_hwi_hwi_const_tree_true,
+ hook_int_const_tree_0, hook_int_const_tree_const_tree_1,
+ hook_constcharptr_const_tree_null,
+ hook_constcharptr_const_rtx_null,
+ hook_constcharptr_const_tree_const_tree_null,
+ hook_constcharptr_int_const_tree_null,
+ hook_constcharptr_int_const_tree_const_tree_null): New.
+ (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true,
+ hook_bool_tree_hwi_hwi_tree_false,
+ hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0,
+ hook_int_tree_tree_1, hook_constcharptr_tree_null,
+ hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null,
+ hook_constcharptr_int_tree_null,
+ hook_constcharptr_int_tree_tree_null): Delete.
+ (default_can_output_mi_thunk_no_vcall): Constify.
+ * hooks.h (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true,
+ hook_bool_tree_hwi_hwi_tree_false,
+ hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0,
+ hook_int_tree_tree_1, hook_constcharptr_tree_null,
+ hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null,
+ hook_constcharptr_int_tree_null,
+ hook_constcharptr_int_tree_tree_null): Delete.
+ (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true,
+ hook_bool_const_tree_hwi_hwi_const_tree_false,
+ hook_bool_const_tree_hwi_hwi_const_tree_true,
+ hook_int_const_tree_0, hook_int_const_tree_const_tree_1,
+ hook_constcharptr_const_tree_null,
+ hook_constcharptr_const_rtx_null,
+ hook_constcharptr_const_tree_const_tree_null,
+ hook_constcharptr_int_const_tree_null,
+ hook_constcharptr_int_const_tree_const_tree_null): New.
+ (default_can_output_mi_thunk_no_vcall): Constify.
+ * integrate.c (function_attribute_inlinable_p): Likewise.
+ * integrate.h (function_attribute_inlinable_p): Likewise.
+ * jump.c (rtx_renumbered_equal_p): Likewise.
+ * output.h (decl_readonly_section, categorize_decl_for_section,
+ default_use_anchors_for_symbol_p, default_binds_local_p,
+ default_binds_local_p_1): Likewise.
+ * rtl.h (rtx_renumbered_equal_p, decl_default_tls_model):
+ Likewise.
+ * target-def.h (TARGET_ASM_CAN_OUTPUT_MI_THUNK,
+ TARGET_VALID_DLLIMPORT_ATTRIBUTE_P, TARGET_VECTOR_OPAQUE_P,
+ TARGET_COMMUTATIVE_P, TARGET_USE_BLOCKS_FOR_CONSTANT_P,
+ TARGET_COMP_TYPE_ATTRIBUTES,
+ TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P,
+ TARGET_MS_BITFIELD_LAYOUT_P, TARGET_MANGLE_TYPE,
+ TARGET_IN_SMALL_DATA_P, TARGET_INVALID_CONVERSION,
+ TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP,
+ TARGET_DWARF_CALLING_CONVENTION): Likewise.
+ * target.h (can_output_mi_thunk, needs_block_p,
+ first_cycle_multipass_dfa_lookahead_guard_spec,
+ vector_alignment_reachable, comp_type_attributes,
+ function_attribute_inlinable_p, ms_bitfield_layout_p, mangle_type,
+ commutative_p, use_blocks_for_constant_p,
+ use_anchors_for_symbol_p, in_small_data_p, binds_local_p,
+ vector_opaque_p, dwarf_calling_convention, stdarg_optimize_hook,
+ invalid_within_doloop, valid_dllimport_attribute_p,
+ split_complex_arg, invalid_arg_for_unprototyped_fn,
+ invalid_conversion, invalid_unary_op, invalid_binary_op):
+ Likewise.
+ * targhooks.c (default_invalid_within_doloop,
+ hook_invalid_arg_for_unprototyped_fn,
+ default_builtin_vector_alignment_reachable): Likewise.
+ (hook_bool_rtx_commutative_p): Delete.
+ (hook_bool_const_rtx_commutative_p): New.
+ * targhooks.h (default_invalid_within_doloop,
+ default_builtin_vector_alignment_reachable,
+ hook_invalid_arg_for_unprototyped_fn): Constify.
+ (hook_bool_rtx_commutative_p): Delete.
+ (hook_bool_const_rtx_commutative_p): New.
+ * varasm.c (bss_initializer_p, decl_default_tls_model,
+ categorize_decl_for_section, decl_readonly_section,
+ default_use_anchors_for_symbol_p, default_binds_local_p,
+ default_binds_local_p_1): Constify.
+
+2007-08-24 Jie Zhang <jie.zhang@analog.com>
+
+ * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Define
+ __NO_BUILTIN if -fno-builtin.
+
+2007-08-24 Jie Zhang <jie.zhang@analog.com>
+
+ * config/bfin/bfin.c (print_operand): Report error instead of
+ ICE for wrong operand.
+
+2007-08-24 Michael Matz <matz@suse.de>
+
+ * Makefile.in (GTFILES_H): Use $(patsubst) instead of $(subst).
+
+2007-08-24 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/33166
+ * tree-ssa.c (useless_type_conversion_p): Split into a
+ recursive and a non-recursive part.
+ (useless_type_conversion_p_1): New function.
+ * tree-ssa-ccp.c (fold_stmt_r): Make sure that the result
+ from maybe_fold_offset_to_reference is trivially convertible
+ to the desired type before doing the simplification.
+
+2007-08-24 Jakub Jelinek <jakub@redhat.com>
+
+ * expr.c (store_expr): Optimize initialization of an array
+ with STRING_CST.
+ * expr.h (builtin_strncpy_read_str): New prototype.
+ * builtins.c (builtin_strncpy_read_str): Remove prototype.
+ No longer static.
+
+2007-08-24 Uros Bizjak <ubizjak@gmail.com>
+
+ PR middle-end/33157
+ * ifcvt.c (noce_find_if_block): Do not clear if_info.cond_earliest
+ field when initializing if_info structure.
+
+2007-08-24 Richard Guenther <rguenther@suse.de>
+
+ * Makefile.in (tree-inline.o): Add $(TARGET_H) and $(INTEGRATE_H)
+ dependencies.
+ * c-objc-common.c (c_cannot_inline_tree_fn): Remove.
+ * langhooks.c (lhd_tree_inlining_cannot_inline_tree_fn): Likewise.
+ * tree-inline.c (inlinable_function_p): Fold in common parts of
+ the cannot_inline_tree_fn langhook.
+ * langhooks-def.h (lhd_tree_inlining_cannot_inline_tree_fn): Remove.
+ (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN): Likewise.
+ (LANG_HOOKS_TREE_INLINING_INITIALIZER): Remove initializer for
+ cannot_inline_tree_fn langhook.
+ * langhooks.h (struct lang_hooks_for_tree_inlining): Remove
+ cannot_inline_tree_fn member.
+
+2007-08-24 Richard Guenther <rguenther@suse.de>
+
+ * expr.c (get_inner_reference): Do computation of bitoffset
+ from offset in a way we can detect overflow reliably.
+
2007-08-24 Jie Zhang <jie.zhang@analog.com>
* crtstuff.c (USE_PT_GNU_EH_FRAME): Don't define for uClibc.
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp 2007-08-24 05:45:15.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog 2007-08-24 21:37:32.000000000 +0000
@@ -1,5 +1,22 @@
+2007-08-24 Ollie Wild <aaw@google.com>
+
+ * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
+ * name-lookup.h (cp_binding_level): Remove vtables member.
+
+2007-08-24 Richard Guenther <rguenther@suse.de>
+
+ * tree.c (cp_cannot_inline_tree_fn): Remove.
+ * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
+ * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
+ Remove define.
+
2007-08-24 Jakub Jelinek <jakub@redhat.com>
+ PR c++/32567
+ * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
+ error_mark_node right away if build_expr_type_conversion
+ returned it.
+
PR c++/32898
* name-lookup.c (set_decl_namespace): lookup_qualified_name failure
is error_mark_node rather than NULL_TREE.
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.