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: Wed, 29 Jun 2005 03:25:27 +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 combine.c compilation at -O0 level:
Overall memory needed: 24900k -> 24904k
Peak memory use before GGC: 9717k
Peak memory use after GGC: 9064k
Maximum of released memory in single GGC run: 2815k
Garbage: 42310k -> 42300k
Leak: 6721k -> 6721k
Overhead: 5842k -> 5842k
GGC runs: 334 -> 335
comparing combine.c compilation at -O1 level:
Overall memory needed: 24376k
Peak memory use before GGC: 17735k
Peak memory use after GGC: 17518k -> 17517k
Maximum of released memory in single GGC run: 2363k
Garbage: 67688k -> 67685k
Leak: 7033k -> 7033k
Overhead: 8420k -> 8420k
GGC runs: 416
comparing combine.c compilation at -O2 level:
Overall memory needed: 24368k -> 24372k
Peak memory use before GGC: 17743k
Peak memory use after GGC: 17518k
Maximum of released memory in single GGC run: 2512k
Garbage: 86965k -> 86964k
Leak: 7214k -> 7214k
Overhead: 11157k -> 11156k
GGC runs: 478
comparing combine.c compilation at -O3 level:
Amount of memory still referenced at the end of compilation increased from 7289k to 7305k, overall 0.22%
Overall memory needed: 24884k -> 24880k
Peak memory use before GGC: 17990k
Peak memory use after GGC: 17578k
Maximum of released memory in single GGC run: 3436k -> 3437k
Garbage: 115875k -> 115875k
Leak: 7289k -> 7305k
Overhead: 14967k -> 14967k
GGC runs: 537
comparing insn-attrtab.c compilation at -O0 level:
Amount of memory still referenced at the end of compilation increased from 11321k to 11561k, overall 2.12%
Overall memory needed: 83372k
Peak memory use before GGC: 71655k
Peak memory use after GGC: 45752k
Maximum of released memory in single GGC run: 37689k
Garbage: 151887k -> 151627k
Leak: 11321k -> 11561k
Overhead: 18884k -> 18883k
GGC runs: 267
comparing insn-attrtab.c compilation at -O1 level:
Overall memory needed: 116992k -> 116996k
Peak memory use before GGC: 99596k
Peak memory use after GGC: 89003k
Maximum of released memory in single GGC run: 33389k
Garbage: 296985k -> 296983k
Leak: 11434k -> 11434k
Overhead: 36876k -> 36876k
GGC runs: 290
comparing insn-attrtab.c compilation at -O2 level:
Overall memory needed: 157132k -> 157108k
Peak memory use before GGC: 118682k
Peak memory use after GGC: 88992k
Maximum of released memory in single GGC run: 33523k
Garbage: 391570k -> 391578k
Leak: 11523k -> 11523k
Overhead: 48978k -> 48978k
GGC runs: 329
comparing insn-attrtab.c compilation at -O3 level:
Overall memory needed: 157092k -> 157084k
Peak memory use before GGC: 118684k
Peak memory use after GGC: 88994k
Maximum of released memory in single GGC run: 33523k
Garbage: 392384k -> 392386k
Leak: 11532k -> 11532k
Overhead: 49101k -> 49101k
GGC runs: 335
comparing Gerald's testcase PR8361 compilation at -O0 level:
Overall memory needed: 124868k
Peak memory use before GGC: 100729k
Peak memory use after GGC: 99725k
Maximum of released memory in single GGC run: 21556k
Garbage: 230059k
Leak: 53186k
Overhead: 40063k
GGC runs: 335
comparing Gerald's testcase PR8361 compilation at -O1 level:
Overall memory needed: 107380k -> 107368k
Peak memory use before GGC: 99640k
Peak memory use after GGC: 98650k
Maximum of released memory in single GGC run: 20173k
Garbage: 439133k
Leak: 55220k
Overhead: 63147k
GGC runs: 471
comparing Gerald's testcase PR8361 compilation at -O2 level:
Overall memory needed: 107380k -> 107376k
Peak memory use before GGC: 99640k
Peak memory use after GGC: 98651k
Maximum of released memory in single GGC run: 20173k
Garbage: 495446k
Leak: 55858k
Overhead: 72718k
GGC runs: 517
comparing Gerald's testcase PR8361 compilation at -O3 level:
Overall memory needed: 112172k
Peak memory use before GGC: 100838k
Peak memory use after GGC: 99839k
Maximum of released memory in single GGC run: 20573k
Garbage: 508375k
Leak: 56151k
Overhead: 73625k
GGC runs: 511
Head of the ChangeLog is:
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog 2005-06-28 15:59:40.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog 2005-06-29 02:25:36.000000000 +0000
@@ -1,3 +1,224 @@
+2005-06-29 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/linux-unwind.h (shmedia_fallback_frame_state):
+ Disable aliasing warning with void * cast.
+ (sh_fallback_frame_state): Likewise.
+
+2005-06-29 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * target.h (gcc_target): New field allocate_initial_value.
+ * target-def.h (TARGET_ALLOCATE_INITIAL_VALUE): New macro.
+ (TARGET_INITIALIZER): Include it.
+ * integrate.c (allocate_initial_values): Use
+ targetm.allocate_initial_value.
+ * system.h: Poison ALLOCATE_INITIAL_VALUE.
+ * config/sh/sh-protos.h (sh_pr_n_sets): Delete.
+ * config/sh/sh.c (sh_pr_n_sets): Make it static.
+ (sh_allocate_initila_value): New function.
+ (TARGET_ALLOCATE_INITIAL_VALUE): Override default.
+ * config/sh/sh.h (ALLOCATE_INITIAL_VALUE): Delete.
+ * doc/tm.texi (TARGET_ALLOCATE_INITIAL_VALUE): Rename and
+ update from ALLOCATE_INITIAL_VALUE.
+
+2005-06-28 Richard Henderson <rth@redhat.com>
+
+ * tree-vectorizer.c (vect_is_simple_reduction): Compare types
+ using TYPE_MAIN_VARIANT.
+
+2005-06-28 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.c (ia64_expand_vecint_compare): Decompose to EQ
+ when using psubN.uuu.
+
+2005-06-29 Kelley Cook <kcook@gcc.gnu.org>
+
+ * doc/gcc.texi: Update FSF address.
+
+2005-06-28 Eric Christopher <echristo@redhat.com>
+
+ PR c/22052
+ PR c/21975
+ * c-decl.c (diagnose_mismatched_decls): Define DECL_EXTERN_INLINE.
+ Use. Fix detection of invalid extern inline redefinition.
+
+2005-06-28 Diego Novillo <dnovillo@redhat.com>
+
+ * tree-optimize.c (init_tree_optimization_passes): Fix typo.
+
+2005-06-28 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * config/rs6000/rs6000.md (setmemsi): s/operand/operands/.
+
+2005-06-28 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.c (ia64_expand_vecint_compare): Use unsigned
+ saturating subtraction for QI and HImode unsigned compares. Use
+ bit arithmetic tricks for SImode unsigned compares.
+ (ia64_expand_vcondu_v2si): Remove.
+ (ia64_expand_vecint_cmov): Don't call it.
+
+2005-06-28 Richard Henderson <rth@redhat.com>
+
+ * rtlanal.c (nonzero_bits1): Use the mode of the value for
+ determining integral-ness for comparisons.
+
+2005-06-28 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * config/rs6000/rs6000.md (setmemsi): Fix operand 2.
+
+2005-06-28 Joseph S. Myers <joseph@codesourcery.com>
+
+ * target.h (invalid_conversion, invalid_unary_op,
+ invalid_binary_op): New hooks.
+ * target-def.h (TARGET_INVALID_CONVERSION,
+ TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP,
+ TARGET_INITIALIZER): Likewise.
+ * hooks.h (hook_constcharptr_tree_tree_null,
+ hook_constcharptr_int_tree_null,
+ hook_constcharptr_int_tree_tree_null): New.
+ * hooks.c (hook_constcharptr_tree_tree_null,
+ hook_constcharptr_int_tree_null,
+ hook_constcharptr_int_tree_tree_null): Likewise.
+ * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION,
+ TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document.
+ * c-convert.c (convert): Use invalid_conversion hook.
+ * c-typeck.c (build_unary_op): Use invalid_unary_op hook.
+ (build_binary_op): Use invalid_binary_op hook.
+ * config/ia64/ia64-modes.def: Define RFmode.
+ * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove.
+ (ia64_expand_movxf_movrf): New.
+ * config/ia64/ia64.md (movxf): Move code to
+ ia64_expand_movxf_movrf.
+ (movrf, movrf_internal): New.
+ * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op,
+ ia64_invalid_binary_op, TARGET_INVALID_CONVERSION,
+ TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New.
+ (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand.
+ Add mode parameter. Make static.
+ (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode
+ as well as XFmode.
+ (ia64_function_arg, ia64_function_value, ia64_register_move_cost,
+ ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode.
+ (ia64_init_builtins): Set up __fpreg as RFmode.
+ (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg.
+
+2006-06-28 Adrian Straetling <straetling@de.ibm.com>
+
+ * builtins.c: (expand_builtin_memset): Rewrite to support
+ 'set_storage_via_setmem'.
+ * expr.c: (enum insn_code setmem_optab): Define.
+ (enum insn_code clrmem_optab): Remove.
+ (set_storage_via_setmem): New function.
+ (clear_storage_via_setmem): Remove.
+ (clear_storage): Replace call to "clear_storage_via_clrmem" with
+ "set_storage_via_setmem".
+ * expr.h: (set_storage_via_setmem): Declare.
+ (CLEAR_RATIO): Redefine using HAVE_setmemM.
+ * optabs.h: (enum insn_code setmem_optab): Declare.
+ (enum insn_code clrmem_optab): Remove.
+ * optabs.c: (init_optabs): Initialize setmem_optab.
+ (enum insn_code clrmem_optab): Remove.
+ * genopinit.c: (otabs): Likewise.
+ * doc/md.texi: Document new standard pattern 'setmem'. Remove
+ 'clrmem'.
+ * config/alpha/alpha.c: (alpha_expand_block_clear): Adjust
+ 'operands' ordering.
+ * config/frv/frv.c: (frv_expand_block_clear): Likewise.
+ * config/rs6000/rs6000.c: (expand_block_clear): Likewise.
+ * config/alpha/alpha.md: ("clrmemqi", "clrmemdi"): Rename to "setmemM".
+ FAIL on operands[2]!=const0_rtx. Adjust 'operands' ordering.
+ * config/avr/avr.md: ("clrmemhi"): Likewise.
+ * config/frv/frv.md: ("clrmemsi"): Likewise.
+ * config/i386/i386.md: ("clrmemsi", "clrmemdi"): Likewise.
+ * config/pa/pa.md: ("clrmemsi", "clrmemdi"): Likewise.
+ * config/rs6000/rs6000.md: ("clrmemsi"): Likewise.
+ * config/s390/s390.md: ("clrmem<mode>"): Likewise.
+
+2005-06-28 Paul Brook <paul@codesourcery.com>
+
+ * Makefile.in: Set and use UNWIND_H. Install as unwind.h.
+ * c-decl.c (finish_decl): Call default_init_unwind_resume_libfunc.
+ * except.c (add_ehspec_entry): Generate arm eabi filter lists.
+ (assign_filter_values): Ditto.
+ (output_ttype): New function.
+ (output_function_exception_table): Use output_ttype. Generate arm
+ eabi filter lists.
+ (default_init_unwind_resume_libfunc): New function.
+ * except.h (default_init_unwind_resume_libfunc): Add prototype.
+ * optabs.c (init_optabs): Don't set unwind_resume_libfunc.
+ * opts.c (decode_options): Use targetm.unwind_tables_default.
+ * target-def.h (TARGET_ASM_TTYPE): Provide and use definition.
+ (TARGET_ARM_EABI_UNWINDER, TARGET_UNWIND_TABLES_DEFAULT): Ditto.
+ * target.h (struct gcc_target): Add asm.ttype, unwind_tables_default
+ and arm_eabi_unwinder.
+ * unwind-c.c: Support Arm EABI unwinder.
+ * unwind.h: Rename ...
+ * unwind-generic.h: ... To this.
+ * doc/tm.texi (TARGET_ASM_TTYPE, TARGET_ARM_EABI_UNWINDER): Document.
+ (TARGET_UNWID_TABLES_DEFAULT): Document.
+
+ * config/arm/arm-protos.h (arm_output_fn_unwind): Add prototype.
+ * config/arm/arm.c (arm_unwind_emit, arm_output_ttype): New functions.
+ (TARGET_UNWIND_EMIT, TARGET_ASM_TTYPE, TARGET_ARM_EABI_UNWINDER):
+ Define.
+ (thumb_pushpop, thumb_output_function_prologue): Output unwinding
+ directives.
+ (arm_unwind_emit_stm, arm_unwind_emit_set): New functions.
+ * config/arm/arm.h (MUST_USE_SJLJ_EXCEPTIONS): Only define when
+ !TARGET_UNWIND_INFO.
+ (ARM_OUTPUT_FN_UNWIND, ARM_EABI_UNWIND_TABLES): Define.
+ * config/arm/bpabi.h (TARGET_UNWIND_INFO): Define.
+ * config/arm/elf.h (ASM_DECLARE_FUNCTION_NAME,
+ ASM_DECLARE_FUNCTION_SIZE): Use ARM_OUTPUT_FN_UNWIND.
+ * config/arm/lib1funcs.asm: Include libunwind.S.
+ * config/arm/libgcc-bpabi.ver: Add unwinding routines.
+ * config/arm/libunwind.S: New file.
+ * config/arm/pr-support.c: New file.
+ * config/arm/t-bpabi (LIB1ASMFUNCS): Add _unwind.
+ (UNWIND_H, LIB2ADDEH, LIB2ADDEHDEP): Set.
+ * config/arm/t-symbian (UNWIND_H, LIB2ADDEH, LIB2ADDEHDEP): Set.
+ * config/arm/unwind-arm.c: New file.
+ * config/arm/unwind-arm.h: New file.
+ * config/i386/t-netware (USER_H): Remove unwind.h.
+ * config/ia64/ia64.h (TARGET_UNWIND_TABLES_DEFAULT): Define.
+
+2005-06-28 DJ Delorie <dj@redhat.com>
+
+ * c-decl.c (pop_scope): Move warning control into warning call.
+ (diagnose_mismatched_decls): Likewise.
+ (pushdecl): Likewise.
+ (start_decl): Likewise.
+ (grokparms): Likewise.
+ (start_function): Likewise.
+ (store_parm_decls_newstyle): Likewise.
+ (store_parm_decls_oldstyle): Likewise.
+ (finish_function): Likewise.
+ (declspecs_add_scspec): Likewise.
+ * c-format.c (decode_format_attr): Likewise.
+ (maybe_read_dollar_number): Likewise.
+ (avoid_dollar_number): Likewise.
+ (finish_dollar_format_checking): Likewise.
+ (check_format_info): Likewise.
+ (check_format_info_main): Likewise.
+ (check_format_types): Likewise.
+ (format_type_warning): Likewise.
+ * c-typeck.c (function_types_compatible_p): Likewise.
+ (build_array_ref): Likewise.
+ (convert_arguments): Likewise.
+ (build_c_cast): Likewise.
+ (store_init_value): Likewise.
+ (process_init_element): Likewise.
+ (c_start_case): Likewise.
+ * stor-layout.c (finalize_record_size): Likewise.
+ * tree-cfg.c (execute_warn_function_noreturn): Likewise.
+ * tree-inline.c (expand_call_inline): Likewise.
+
+2005-06-28 Uros Bizjak <uros@kss-loka.si>
+
+ PR target/22134
+ * config/i386/i386.md (fist<mode>2_with_temp splitter):
+ Clobber memory operand, not scratch register.
+
2005-06-28 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/s390.c (machine_function): New field has_landing_pad_p.
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp 2005-06-27 20:36:02.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog 2005-06-29 02:25:43.000000000 +0000
@@ -1,3 +1,16 @@
+2005-06-28 Joseph S. Myers <joseph@codesourcery.com>
+
+ * cvt.c (ocp_convert): Use invalid_conversion hook.
+ * typeck.c (build_binary_op): Use invalid_binary_op hook.
+ (build_unary_op): Use invalid_unary_op hook.
+
+2005-06-28 Paul Brook <paul@codesourcery.com>
+
+ * Make-lang.in (cp/except.o): Depend on $(TARGET_H)
+ * except.c: Include target.h.
+ (init_exception_processing): Initialize unwind_resume_libfunc.
+ * doc/tm.texi: Document TARGET_ASM_TTYPE
+
2005-06-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* call.c (build_over_call): Pass in named argument list to
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.