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 combine.c compilation at -O0 level:
    Overall memory needed: 24912k -> 24916k
    Peak memory use before GGC: 9717k
    Peak memory use after GGC: 9064k
    Maximum of released memory in single GGC run: 2815k -> 2816k
    Garbage: 42296k -> 42335k
    Leak: 6720k
    Overhead: 5839k -> 5837k
    GGC runs: 335

comparing combine.c compilation at -O1 level:
  Amount of produced GGC garbage increased from 67682k to 67904k, overall 0.33%
    Overall memory needed: 24376k -> 24356k
    Peak memory use before GGC: 17735k -> 17711k
    Peak memory use after GGC: 17517k
    Maximum of released memory in single GGC run: 2467k -> 2468k
    Garbage: 67682k -> 67904k
    Leak: 7033k -> 7030k
    Overhead: 8417k -> 8039k
    GGC runs: 416 -> 419

comparing combine.c compilation at -O2 level:
  Amount of produced GGC garbage increased from 86966k to 87247k, overall 0.32%
    Overall memory needed: 24372k -> 24376k
    Peak memory use before GGC: 17742k -> 17718k
    Peak memory use after GGC: 17517k
    Maximum of released memory in single GGC run: 2615k -> 2616k
    Garbage: 86966k -> 87247k
    Leak: 7214k -> 7207k
    Overhead: 11157k -> 10768k
    GGC runs: 478 -> 485

comparing combine.c compilation at -O3 level:
  Amount of produced GGC garbage increased from 115909k to 116214k, overall 0.26%
    Overall memory needed: 24884k -> 24844k
    Peak memory use before GGC: 17965k -> 17968k
    Peak memory use after GGC: 17552k -> 17549k
    Maximum of released memory in single GGC run: 3438k -> 3439k
    Garbage: 115909k -> 116214k
    Leak: 7289k
    Overhead: 14962k -> 14431k
    GGC runs: 535

comparing insn-attrtab.c compilation at -O0 level:
    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: 151626k -> 151641k
    Leak: 11560k
    Overhead: 18882k -> 18881k
    GGC runs: 267

comparing insn-attrtab.c compilation at -O1 level:
  Amount of produced GGC garbage increased from 296995k to 298292k, overall 0.44%
    Overall memory needed: 117024k -> 116664k
    Peak memory use before GGC: 99598k -> 99408k
    Peak memory use after GGC: 89016k -> 88890k
    Maximum of released memory in single GGC run: 33389k -> 33484k
    Garbage: 296995k -> 298292k
    Leak: 11427k -> 11427k
    Overhead: 36875k -> 35521k
    GGC runs: 290

comparing insn-attrtab.c compilation at -O2 level:
  Amount of produced GGC garbage increased from 391585k to 392905k, overall 0.34%
    Overall memory needed: 157104k -> 155568k
    Peak memory use before GGC: 118682k -> 118554k
    Peak memory use after GGC: 88992k -> 88864k
    Maximum of released memory in single GGC run: 33523k -> 33619k
    Garbage: 391585k -> 392905k
    Leak: 11516k -> 11515k
    Overhead: 48977k -> 47614k
    GGC runs: 329

comparing insn-attrtab.c compilation at -O3 level:
  Amount of produced GGC garbage increased from 392389k to 393708k, overall 0.34%
    Overall memory needed: 157088k -> 155556k
    Peak memory use before GGC: 118684k -> 118558k
    Peak memory use after GGC: 88994k -> 88866k
    Maximum of released memory in single GGC run: 33523k -> 33619k
    Garbage: 392389k -> 393708k
    Leak: 11530k -> 11535k
    Overhead: 49101k -> 47731k
    GGC runs: 335 -> 334

comparing Gerald's testcase PR8361 compilation at -O0 level:
  Amount of produced GGC garbage increased from 229924k to 230928k, overall 0.44%
    Overall memory needed: 124856k
    Peak memory use before GGC: 100707k
    Peak memory use after GGC: 99710k
    Maximum of released memory in single GGC run: 21559k -> 21552k
    Garbage: 229924k -> 230928k
    Leak: 53152k -> 53150k
    Overhead: 39919k -> 39837k
    GGC runs: 335 -> 337

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Amount of produced GGC garbage increased from 444315k to 646022k, overall 45.40%
  Amount of memory still referenced at the end of compilation increased from 55140k to 58288k, overall 5.71%
    Overall memory needed: 107348k -> 108940k
    Peak memory use before GGC: 99619k -> 99624k
    Peak memory use after GGC: 98632k
    Maximum of released memory in single GGC run: 20167k -> 20596k
    Garbage: 444315k -> 646022k
    Leak: 55140k -> 58288k
    Overhead: 63668k -> 80524k
    GGC runs: 472 -> 525

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Overall memory allocated via mmap and sbrk increased from 107360k to 109780k, overall 2.25%
  Amount of produced GGC garbage increased from 500611k to 737429k, overall 47.31%
  Amount of memory still referenced at the end of compilation increased from 55793k to 58987k, overall 5.72%
    Overall memory needed: 107360k -> 109780k
    Peak memory use before GGC: 99619k -> 99624k
    Peak memory use after GGC: 98632k
    Maximum of released memory in single GGC run: 20166k -> 20595k
    Garbage: 500611k -> 737429k
    Leak: 55793k -> 58987k
    Overhead: 73224k -> 97660k
    GGC runs: 518 -> 591

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Amount of produced GGC garbage increased from 513755k to 780226k, overall 51.87%
  Amount of memory still referenced at the end of compilation increased from 56058k to 60155k, overall 7.31%
    Overall memory needed: 112784k -> 112004k
    Peak memory use before GGC: 101139k -> 101141k
    Peak memory use after GGC: 100133k
    Maximum of released memory in single GGC run: 20625k -> 21090k
    Garbage: 513755k -> 780226k
    Leak: 56058k -> 60155k
    Overhead: 74184k -> 101674k
    GGC runs: 510 -> 595

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2005-06-30 12:35:28.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2005-07-01 09:00:13.000000000 +0000
@@ -1,3 +1,275 @@
+2005-07-01  Jakub Jelinek  <jakub@redhat.com>
+
+	PR target/22262
+	* config/i386/i386.md (stack_protect_test_si,
+	stack_protect_test_di): Add earlyclobber for scratch 3.
+	* config/rs6000/rs6000.md (stack_protect_testsi,
+	stack_protect_testdi): Add earlyclobber for scratch 3,
+	remove earlyclobber from scratch 4.
+
+2005-06-30  Diego Novillo  <dnovillo@redhat.com>
+
+	PR 21584
+	PR 22219
+	* tree-ssa-alias.c (create_name_tags): Also process
+	non-dereferenced pointers.
+	Remove argument 'ai'.  Update all callers.
+
+2005-06-30  Andrew Pinski  <pinskia@physics.uc.edu>
+
+	* config/rs6000/darwin.h (STARTING_FRAME_OFFSET):
+	Set to 0 for FRAME_GROWS_DOWNWARD.
+	(REGISTER_NAMES): Add sfp.
+
+2005-07-01  Kelley Cook  <kcook@gcc.gnu.org>
+
+	* config/arm/libunwind.S, config/arm/pr-support.c,
+	config/arm/unwind-arm.c, config/arm/unwind-arm.h,
+	config/c4x/predicates.md, tree-object-size.c: Update FSF address.
+
+2005-06-30  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+	PR target/22260
+	* config/sparc/sparc.c (emit_and_preserve): Add 2nd register.
+	Preserve the 2nd register too, if present.
+	(sparc_output_mi_thunk) <PIC case>: Preserve the PIC register too.
+	Adjust call to emit_and_preserve.
+
+2005-06-30  Zack Weinberg  <zack@codesourcery.com>
+	    Jakub Jelinek  <jakub@redhat.com>
+
+	* pretty-print.h (PP_NL_ARGMAX): New.
+	(text_info): Add locus.
+	(struct chunk_info): New.
+	(output_buffer): Add formatted_obstack, chunk_obstack, and
+	cur_chunk_array. Change obstack to a pointer.
+	(pp_wrapping_mode_t, pp_wrapping_mode, pp_set_verbatim_wrapping): New.
+	(struct pretty_print_info): Replace ideal_maximum_length and
+	prefixing_rule with wrapping.
+	(pp_line_cutoff, pp_prefixing_rule): Update to match.
+	Update prototypes and wrapper macros throughout.
+	* pretty-print.c (pp_formatted_text_data, pp_append_r)
+	(pp_base_clear_output_area, pp_construct, pp_base_formatted_text)
+	(pp_base_last_position_in_text, pp_base_newline, pp_base_character):
+	Update for changes to pp structure.
+	(pp_base_prepare_to_format, pp_base_format_text): Delete.
+	(pp_base_format, pp_base_output_formatted_text): New functions.
+	(pp_base_format_verbatim): Use pp_set_verbatim_wrapping.
+	(pp_verbatim): Clear text.locus.
+	(pp_printf): Likewise.  Use pp_format and pp_output_formatted_text.
+	* c-objc-common.c (c_tree_printer): Update function signature.
+	* diagnostic.c (diagnostic_initialize): Update for changes to
+	pp structure.
+	(diagnostic_report_diagnostic): Call pp_format and then
+	pp_output_formatted_text.
+	(verbatim): Clear text.locus.
+	* diagnostic.h (diagnostic_prefixing_rule, diagnostic_line_cutoff):
+	Update for changes to pp structure.
+
+	* c-lang.c: No need to include c-pretty-print.h.
+	* Makefile.in: Remove bogus line containing only a tab.
+	(c-lang.o): Update dependencies.
+	* toplev.c (announce_function): Don't use verbatim.
+	(default_tree_printer): Update signature.
+
+	* objc/objc-lang.c: No need to include c-pretty-print.h.
+	* objc/Make-lang.in: Update dependencies.
+
+2005-06-29  Daniel Berlin  <dberlin@dberlin.org>
+
+	* tree-complex.c (complex_variable_components): Now a hashtable.
+	(cvc_lookup): Ditto.
+	(cvc_insert): Ditto.
+	(create_components): Use referenced var iterator.
+	Initialize hashtable.	Use cvc_insert/lookup.
+	(extract_components): Use cvc_insert/lookup.
+	(update_complex_components): Ditto.
+	(update_complex_components_on_edge): Ditto.
+	* tree-dfa.c (referenced_vars): Now a hashtable.
+	(dump_referenced_vars): Use iterator.
+	(referenced_var_lookup): New function.
+	(referenced_var_insert): Ditto.
+	(add_referenced_var): Use referenced_var_insert.
+	(mark_new_vars_to_rename): Use DECL_UID.
+	* tree-flow-inline.h (first_htab_element): New function.
+	(end_htab_p): Ditto.
+	(next_htab_element): Ditto.
+	(first_referenced_var): Ditto.
+	(end_referenced_vars_p): Ditto.
+	(next_referenced_var): Ditto.
+	(is_call_clobbered): Use DECL_UID.
+	(mark_call_clobbered): Ditto.
+	(clear_call_clobbered): Ditto.
+	(mark_non_addressable): Ditto.
+	* tree-flow.h (htab_iterator): New struct.
+	(FOR_EACH_HTAB_ELEMENT): New macro.
+	(struct int_tree_map): New struct.
+	(int_tree_map_hash): Prototype.
+	(int_tree_map_eq): Ditto.
+	(referenced_var_iterator): Ditto.
+	(FOR_EACH_REFERENCED_VAR): New macro.
+	(referenced_vars): Now a hashtable.
+	* tree-into-ssa.c (symbol_marked_for_renaming): Use DECL_UID.
+	(add_new_name_mapping): Ditto.
+	(mark_def_sites): Ditto.
+	(insert_phi_nodes): Use referenced_var iterator.
+	(mark_def_site_blocks): Ditto.
+	(mark_sym_for_renaming): Use DECL_UID.
+	* tree-sra.c (is_sra_candidate_decl): Use DECL_UID.
+	(lookup_element): Ditto.
+	(find_candidates_for_sra): Use referenced_vars iterator.
+	Use DECL_UID.
+	* tree-ssa-alias.c (NUM_REFERENCES): New macro.
+	(NUM_REFERENCES_CLEAR): Ditto.
+	(NUM_REFERENCES_INC): Ditto.
+	(NUM_REFERENCES_SET): Ditto.
+	(alias_obstack): New bitmap obstack.
+	(struct alias_map_d): Use bitmap, not sbitmap.
+	(struct alias_info): Remove num_references.
+	(init_alias_info): Use referenced_var iterator.
+	Initialize bitmap obstack.
+	(delete_alias_info): Use referenced_var iterator.
+	Free bitmap obstack.
+	(compute_points_to_and_addr_escape): Use DECL_UID.
+	Use new NUM_REFERENCES macros.
+	(compute_flow_sensitive_aliasing): may_aliases is now a bitmap.
+	Use new NUM_REFERENCES macros.
+	(group_aliases_into): Update prototype to use bitmap.
+	(setup_pointers_and_addressables): Use referenced_vars iterator.
+	Use DECL_UID. Use new NUM_REFERENCES macros.
+	(add_pointed_to_var): Use DECL_UID.
+	(dump_alias_info): Use referenced_var iterator.
+	(add_type_alias): Ditto.
+	(used_portions): Now a hashtable.
+	(used_part_map_eq): New function.
+	(used_part_map_hash): Ditto.
+	(free_used_part_map): Ditto.
+	(up_lookup): Ditto.
+	(up_insert): Ditto.
+	(get_or_create_used_part_for): Use up_lookup.
+	(create_overlap_variables_for): Ditto.
+	(find_used_portions): Use up_insert.
+	Use DECL_UID.
+	(create_structure_vars): Init used_portions hashtable, use
+	referenced_vars iterator.
+	* tree-ssa-live.c (create_ssa_var_map): sbitmaps became bitmaps.
+	Use DECL_UID.
+	* tree-ssa-loop-im.c (gather_mem_refs_stmt): Use DECL_UID.
+	* tree-ssa-operands.c (get_asm_expr_operands): Ditto.
+	(note_addressable): Ditto.
+	* tree-ssa-structalias.c (set_uids_in_ptset): Ditto.
+	* tree-ssa.c (verify_flow_insensitive_alias_info): Use
+	referenced_var iterator.
+	Use DECL_UID.
+	(delete_tree_ssa): Ditto.
+	(int_tree_map_eq): New function.
+	(int_tree_map_hash): Ditto.
+	* tree-stdarg.c (find_va_list_reference): Use DECL_UID.
+	(va_list_ptr_read): Ditto.
+	(va_list_counter_struct_op): Ditto.
+	(va_list_ptr_write): Ditto.
+	(check_va_list_escapes): Ditto.
+	(check_all_va_list_escapes): Ditto.
+	(execute_optimize_stdarg): Ditto.
+	* tree-tailcall.c (suitable_for_tail_opt_p): Used referenced_var
+	iterator. 
+
+2005-06-30  Andrew Pinski  <pinskia@physics.uc.edu>
+
+	* config/rs6000/darwin.h (FRAME_POINTER_REGNUM): Rename to ...
+	(HARD_FRAME_POINTER_REGNUM): this.
+
+2005-06-30  Jan Hubicka  <jh@suse.cz>
+
+	* ipa-inline.c (cgraph_clone_inlined_nodes): Revert previous patch.
+
+2005-06-30  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+	PR middle-end/22247
+	* tree-ssa-structalias.c (build_constraint_graph, scc_visit,
+	process_unification_queue, init_topo_info, topo_visit,
+	init_scc_info, free_scc_info, perform_var_substitution,
+	solve_graph): Use unsigned instead of uint.
+	
+2005-06-30  Jakub Jelinek  <jakub@redhat.com>
+
+	* function.c (gen_stack_protect_test): Add third argument.
+
+2005-06-30  J. D. Johnston  <jjohnst@us.ibm.com>
+
+	* gthr-tpf.h (CE2THRCPTR): Change field offset to 16.
+
+2005-06-30  Kazu Hirata  <kazu@codesourcery.com>
+
+	* config/c4x/c4x-protos.h: Remove the prototypes for those
+	functions removed from c4x.c.  Add prototypes for those
+	functions exported in c4x.c.
+	* config/c4x/c4x.c (any_operand, fp_zero_operand,
+	const_operand, stik_const_operand, not_const_operand,
+	reg_operand, r0r1_reg_operand, r2r3_reg_operand,
+	ext_low_reg_operand, ext_reg_operand, std_reg_operand,
+	std_or_reg_operand, addr_reg_operand, index_reg_operand,
+	dp_reg_operand, sp_reg_operand, st_reg_operand,
+	rc_reg_operand, call_address_operand,
+	symbolic_address_operand, dst_operand, src_operand,
+	src_hi_operand, lsrc_operand, tsrc_operand,
+	nonimmediate_src_operand, nonimmediate_lsrc_operand,
+	reg_or_const_operand, par_ind_operand, parallel_operand):
+	Remove.
+	(c4x_immed_float_p, c4x_a_register, c4x_x_register,
+	c4x_K_constant, c4x_N_constant, c4x_O_constant,
+	c4x_S_indirect): Export.
+	* config/c4x/c4x.h (PREDICATE_CODES): Remove.
+	* config/c4x/c4x.md: Include predicates.md.
+	* config/c4x/predicates.md: New.
+
+2005-06-30  Jakub Jelinek  <jakub@redhat.com>
+
+	* function.c (stack_protect_epilogue): Pass label to
+	stack_protect_test, assume it emitted also the conditional
+	branch.
+	* doc/md.texi (stack_protect_test): Adjust documentation.
+	* config/i386/i386.md (stack_protect_test): Add third argument,
+	emit beq with operands[2].
+	* config/rs6000/rs6000.h (FRAME_GROWS_DOWNWARD): Define to
+	flag_stack_protect != 0.
+	* config/rs6000/rs6000.md (UNSPEC_SP_SET, UNSPEC_SP_TEST): New
+	constants.
+	(stack_protect_set, stack_protect_test): New expanders.
+	(stack_protect_setsi, stack_protect_setdi, stack_protect_testsi,
+	stack_protect_testdi): New insns.
+	* config/rs6000/rs6000.c (rs6000_stack_protect_fail): New function.
+	(TARGET_STACK_PROTECT_FAIL): Define.
+	(rs6000_generate_compare): Handle UNSPEC_SP_TEST.
+
+	* config/rs6000/rs6000.h (FIRST_PSEUDO_REGISTER): Increment.
+	(DWARF_FRAME_REGISTERS, DWARF_REG_TO_UNWIND_COLUMN): Adjust, so
+	that addition of sfp doesn't change these.
+	(FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS,
+	REG_ALLOC_ORDER): Add sfp.
+	(INT_REGNO_P): Include FRAME_POINTER_REGNUM.
+	(FRAME_POINTER_REGNUM): Define to 113.
+	(HARD_FRAME_POINTER_REGNUM): Define to 31.
+	(REG_CLASS_CONTENTS, REGNO_REG_CLASS): Add sfp.
+	(STARTING_FRAME_OFFSET): Set to 0 for FRAME_GROWS_DOWNWARD.
+	(ELIMINABLE_REGS): Never eliminate to
+	FRAME_POINTER_REGNUM, but HARD_FRAME_POINTER_REGNUM
+	instead.  Add eliminations from FRAME_POINTER_REGNUM.
+	(REGNO_OK_FOR_INDEX_P, REGNO_OK_FOR_BASE_P, INT_REG_OK_FOR_INDEX_P):
+	Include FRAME_POINTER_REGNUM.
+	(REGISTER_NAMES): Add sfp.
+	* config/rs6000/rs6000.c (rs6000_reg_names): Add sfp.
+	(alt_reg_names): Likewise.
+	(rs6000_stack_info): Handle FRAME_GROWS_DOWNWARD.
+	(rs6000_emit_prologue): Use HARD_FRAME_POINTER_REGNUM
+	instead of FRAME_POINTER_REGNUM.
+	(rs6000_initial_elimination_offset): Never eliminate to
+	FRAME_POINTER_REGNUM, but HARD_FRAME_POINTER_REGNUM
+	instead.  Add elimination offsets from FRAME_POINTER_REGNUM.
+
+	* config/rs6000/sysv4.h (RS6000_VARARGS_AREA): Only return non-zero
+	if DEFAULT_ABI == ABI_V4.
+
 2005-06-30  Steven Bosscher  <stevenb@suse.de>
 
 	* coretypes.h (tls_model): Add TLS_MODEL_NONE as 0.
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2005-06-30 12:35:33.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2005-07-01 09:00:47.000000000 +0000
@@ -1,3 +1,13 @@
+2005-06-30  Zack Weinberg  <zack@codesourcery.com>
+	    Jakub Jelinek  <jakub@redhat.com>
+
+	* cp-lang.c: No need to include cxx-pretty-print.h.
+	* error.c (cp_printer): Update signature.  No need to process
+	flags.
+	(print_instantiation_partial_context): Output last newline
+	with pp_base_newline.
+	* Make-lang.in: Update dependencies.
+
 2005-06-30  Steven Bosscher  <stevenb@suse.de>
 
 	* decl.c (start_decl): Replace DECL_THREAD_LOCAL with


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]