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, 09 Mar 2007 11:24:20 +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: 7382k
Peak memory use before GGC: 2260k
Peak memory use after GGC: 1949k
Maximum of released memory in single GGC run: 311k
Garbage: 446k
Leak: 2283k
Overhead: 456k
GGC runs: 3
comparing empty function compilation at -O0 -g level:
Overall memory needed: 7398k -> 7402k
Peak memory use before GGC: 2288k
Peak memory use after GGC: 1977k
Maximum of released memory in single GGC run: 311k
Garbage: 449k
Leak: 2316k
Overhead: 461k
GGC runs: 3
comparing empty function compilation at -O1 level:
Overall memory needed: 7514k
Peak memory use before GGC: 2260k
Peak memory use after GGC: 1949k
Maximum of released memory in single GGC run: 311k
Garbage: 452k
Leak: 2286k
Overhead: 457k
GGC runs: 4
comparing empty function compilation at -O2 level:
Overall memory needed: 7522k
Peak memory use before GGC: 2261k
Peak memory use after GGC: 1950k
Maximum of released memory in single GGC run: 311k
Garbage: 455k
Leak: 2286k
Overhead: 457k
GGC runs: 4
comparing empty function compilation at -O3 level:
Overall memory needed: 7522k
Peak memory use before GGC: 2261k
Peak memory use after GGC: 1950k
Maximum of released memory in single GGC run: 311k
Garbage: 455k
Leak: 2286k
Overhead: 457k
GGC runs: 4
comparing combine.c compilation at -O0 level:
Overall memory needed: 17838k
Peak memory use before GGC: 9262k
Peak memory use after GGC: 8849k
Maximum of released memory in single GGC run: 2578k
Garbage: 36909k
Leak: 6578k
Overhead: 5037k
GGC runs: 279
comparing combine.c compilation at -O0 -g level:
Overall memory needed: 19854k
Peak memory use before GGC: 10878k
Peak memory use after GGC: 10509k
Maximum of released memory in single GGC run: 2354k
Garbage: 37491k
Leak: 9471k
Overhead: 5743k
GGC runs: 268
comparing combine.c compilation at -O1 level:
Overall memory needed: 35266k -> 35262k
Peak memory use before GGC: 19340k
Peak memory use after GGC: 19125k
Maximum of released memory in single GGC run: 2169k -> 2172k
Garbage: 57234k -> 56694k
Leak: 6607k
Overhead: 6375k -> 6297k
GGC runs: 351 -> 352
comparing combine.c compilation at -O2 level:
Overall memory needed: 37618k -> 37570k
Peak memory use before GGC: 19378k -> 19370k
Peak memory use after GGC: 19175k -> 19177k
Maximum of released memory in single GGC run: 2156k -> 2159k
Garbage: 68665k -> 68081k
Leak: 6724k -> 6726k
Overhead: 8009k -> 8002k
GGC runs: 405
comparing combine.c compilation at -O3 level:
Peak amount of GGC memory still allocated after garbage collecting increased from 19531k to 19558k, overall 0.14%
Overall memory needed: 46990k -> 46894k
Peak memory use before GGC: 20414k -> 20388k
Peak memory use after GGC: 19531k -> 19558k
Maximum of released memory in single GGC run: 3147k -> 3148k
Garbage: 101051k -> 100891k
Leak: 6857k -> 6864k
Overhead: 12242k -> 12203k
GGC runs: 453 -> 455
comparing insn-attrtab.c compilation at -O0 level:
Overall memory needed: 102946k -> 102950k
Peak memory use before GGC: 68624k
Peak memory use after GGC: 44728k
Maximum of released memory in single GGC run: 36429k
Garbage: 129360k
Leak: 9581k
Overhead: 16801k
GGC runs: 208
comparing insn-attrtab.c compilation at -O0 -g level:
Overall memory needed: 104334k
Peak memory use before GGC: 69786k
Peak memory use after GGC: 45996k
Maximum of released memory in single GGC run: 36430k
Garbage: 130583k
Leak: 11289k
Overhead: 17199k
GGC runs: 206
comparing insn-attrtab.c compilation at -O1 level:
Amount of produced GGC garbage increased from 263554k to 264102k, overall 0.21%
Overall memory needed: 147594k -> 147586k
Peak memory use before GGC: 85862k -> 85946k
Peak memory use after GGC: 80069k -> 80068k
Maximum of released memory in single GGC run: 32814k -> 32841k
Garbage: 263554k -> 264102k
Leak: 9401k
Overhead: 27491k -> 27570k
GGC runs: 226
comparing insn-attrtab.c compilation at -O2 level:
Overall memory allocated via mmap and sbrk increased from 192586k to 196462k, overall 2.01%
Amount of produced GGC garbage increased from 300055k to 300630k, overall 0.19%
Overall memory needed: 192586k -> 196462k
Peak memory use before GGC: 87178k -> 87233k
Peak memory use after GGC: 80139k -> 80138k
Maximum of released memory in single GGC run: 30017k -> 30046k
Garbage: 300055k -> 300630k
Leak: 9398k -> 9399k
Overhead: 33191k -> 33271k
GGC runs: 246 -> 247
comparing insn-attrtab.c compilation at -O3 level:
Overall memory allocated via mmap and sbrk increased from 192574k to 196518k, overall 2.05%
Amount of produced GGC garbage increased from 300719k to 301272k, overall 0.18%
Overall memory needed: 192574k -> 196518k
Peak memory use before GGC: 87191k -> 87247k
Peak memory use after GGC: 80152k
Maximum of released memory in single GGC run: 30079k -> 30107k
Garbage: 300719k -> 301272k
Leak: 9403k -> 9404k
Overhead: 33390k -> 33468k
GGC runs: 246 -> 247
comparing Gerald's testcase PR8361 compilation at -O0 level:
Overall memory needed: 147353k -> 147363k
Peak memory use before GGC: 90241k
Peak memory use after GGC: 89347k
Maximum of released memory in single GGC run: 17775k
Garbage: 207686k
Leak: 49044k
Overhead: 23533k
GGC runs: 410
comparing Gerald's testcase PR8361 compilation at -O0 -g level:
Overall memory needed: 165173k -> 165191k
Peak memory use before GGC: 102846k
Peak memory use after GGC: 101827k
Maximum of released memory in single GGC run: 18129k
Garbage: 214200k
Leak: 72357k
Overhead: 29428k
GGC runs: 384
comparing Gerald's testcase PR8361 compilation at -O1 level:
Amount of produced GGC garbage increased from 344087k to 344608k, overall 0.15%
Overall memory needed: 141810k
Peak memory use before GGC: 101814k -> 101808k
Peak memory use after GGC: 100791k
Maximum of released memory in single GGC run: 17236k
Garbage: 344087k -> 344608k
Leak: 49752k
Overhead: 30047k -> 30119k
GGC runs: 527
comparing Gerald's testcase PR8361 compilation at -O2 level:
Amount of produced GGC garbage increased from 372917k to 373449k, overall 0.14%
Overall memory needed: 143834k -> 143838k
Peak memory use before GGC: 102485k -> 102423k
Peak memory use after GGC: 101439k -> 101408k
Maximum of released memory in single GGC run: 17233k
Garbage: 372917k -> 373449k
Leak: 50744k -> 50784k
Overhead: 33991k -> 34047k
GGC runs: 561 -> 563
comparing Gerald's testcase PR8361 compilation at -O3 level:
Amount of produced GGC garbage increased from 390270k to 390791k, overall 0.13%
Overall memory needed: 146378k -> 146406k
Peak memory use before GGC: 104242k -> 104244k
Peak memory use after GGC: 103207k
Maximum of released memory in single GGC run: 17610k
Garbage: 390270k -> 390791k
Leak: 51028k -> 51067k
Overhead: 35342k -> 35415k
GGC runs: 572 -> 573
comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
Overall memory needed: 244573k
Peak memory use before GGC: 80960k
Peak memory use after GGC: 58699k
Maximum of released memory in single GGC run: 44133k
Garbage: 144343k
Leak: 7611k
Overhead: 24815k
GGC runs: 79
comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
Overall memory needed: 245409k
Peak memory use before GGC: 81606k
Peak memory use after GGC: 59345k
Maximum of released memory in single GGC run: 44122k
Garbage: 144514k
Leak: 9378k
Overhead: 25310k
GGC runs: 89
comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
Overall memory needed: 245194k -> 245198k
Peak memory use before GGC: 85136k -> 85157k
Peak memory use after GGC: 74845k
Maximum of released memory in single GGC run: 36137k
Garbage: 222588k -> 222608k
Leak: 20854k
Overhead: 30547k -> 30547k
GGC runs: 81
comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
Overall memory needed: 498374k -> 498606k
Peak memory use before GGC: 79831k
Peak memory use after GGC: 74845k
Maximum of released memory in single GGC run: 33438k
Garbage: 229635k -> 229655k
Leak: 20944k
Overhead: 32629k -> 32629k
GGC runs: 91
comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
Overall memory needed: 1186826k -> 1188234k
Peak memory use before GGC: 201747k
Peak memory use after GGC: 190209k
Maximum of released memory in single GGC run: 80701k
Garbage: 375638k -> 375660k
Leak: 46310k -> 46310k
Overhead: 49354k -> 49354k
GGC runs: 70
Head of the ChangeLog is:
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog 2007-03-08 17:48:28.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog 2007-03-09 09:21:21.000000000 +0000
@@ -1,3 +1,114 @@
+2007-03-09 Alexandre Oliva <aoliva@redhat.com>
+
+ * rtl.def (ASM_INPUT): Add location.
+ * rtl.h (ASM_INPUT_SOURCE_LOCATION): New.
+ (ASM_INPUT_SOURCE_FILE, ASM_INPUT_SOURCE_LINE): New.
+ (decode_asm_operands): Add loc operand.
+ (gen_rtx_ASM_INPUT, gen_rtx_ASM_INPUT_loc): Define.
+ * stmt.c (expand_asm): Rename to...
+ (expand_asm_loc): ... this. Add locus argument. Pass it on to
+ gen_rtx_ASM_INPUT_loc.
+ (expand_asm_expr): Adjust.
+ * recog.c (decode_asm_operands): Add loc operand.
+ (check_asm_operands, extract_insn): Adjust.
+ * reload1.c (maybe_fix_stack_asms): Likewise.
+ * final.c (asm_insn_count): Likewise.
+ (final_scan_insn): Output # line before and after asm.
+
+2007-03-09 Daniel Berlin <dberlin@dberlin.org>
+
+ * tree-ssa-structalias.c (variable_info): Remove
+ finished_solution.
+ (new_var_info): Ditto.
+ (shared_bitmap_info_t): New structure.
+ (shared_bitmap_table): New variable.
+ (shared_bitmap_hash): New function.
+ (shared_bitmap_eq): Ditto
+ (shared_bitmap_lookup): Ditto.
+ (shared_bitmap_add): Ditto.
+ (merge_smts_into): Change to take bitmap directly.
+ (find_what_p_points_to): Rewrite to use shared bitmap hashtable.
+ (init_alias_vars): Init shared bitmap hashtable.
+ (delete_points_to_sets): Delete shared bitmap hashtable.
+ * tree-ssa-operands.c (add_virtual_operand): Partially revert the
+ is_aliased removal as a change that was still necessary was
+ deleted.
+
+2007-03-09 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.h (override_options): Conditionally disable
+ x86_sahf for 64bit targets only.
+
+2007-03-08 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR C/31072
+ * c-decl.c (merge_decls): Don't call make_var_volatile.
+ * varasm.c (make_var_volatile): Remove.
+ * output.h (make_var_volatile): Remove.
+
+2007-03-08 Zdenek Dvorak <dvorakz@suse.cz>
+
+ PR tree-optimization/31085
+ * tree-ssa-address.c (create_mem_ref): Fix test of type of base.
+
+2007-03-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.def (lceil, lceilf, lceill, lfloor, lfloorf, lfloorl,
+ llceil, llceilf, llceill, llfloor, llfloorf, llfloorl): Mark with
+ ATTR_CONST_NOTHROW_LIST.
+
+ * fold-const.c (tree_expr_nonnegative_warnv_p): Handle
+ FIX_TRUNC_EXPR.
+
+2007-03-08 Diego Novillo <dnovillo@redhat.com>
+
+ * doc/tree-ssa.texi: Remove documentation for V_MUST_DEF.
+
+2007-03-08 Geoffrey Keating <geoffk@apple.com>
+
+ PR 31013
+ * gccspec.c (lang_specific_driver): Do nothing when NEXT_OBJC_RUNTIME
+ is declared.
+ * config/darwin.h (REAL_LIBGCC_SPEC): When -fgnu-runtime is
+ passed, use shared libgcc.
+
+2007-03-08 Roger Sayle <roger@eyesopen.com>
+
+ * tree-eh.c (do_return_redirection): Call build_gimple_modify_stmt
+ instead of calling build2 with a GIMPLE_MODIFY_STMT.
+ (honor_protect_cleanup_actions, lower_try_finally_switch):
+ Likewise.
+ * tree-if-conv.c (replace_phi_with_cond_gimple_modify_stmt,
+ ifc_temp_var): Likewise.
+ * tree-inline.c (setup_one_parameter): Likewise.
+ * tree-mudflap.c (mf_decl_cache_locals,
+ mf_build_check_statement_for): Likewise.
+ * tree-nested.c (init_tmp_var, save_tmp_var,
+ finalize_nesting_tree_1): Likewise.
+ * tree-outof-ssa.c (insert_copy_on_edge,
+ insert_backedge_copies): Likewise.
+ * tree-profile.c (tree_gen_edge_profiler,
+ tree_gen_ic_profiler): Likewise.
+ * tree-scalar-evolution.c (scev_const_prop): Likewise.
+ * tree-sra.c (sra_build_assignment): Likewise.
+ * tree-ssa-loop-im.c (determine_invariantness_stmt): Likewise.
+ * tree-ssa-math-opts.c (insert_reciprocals,
+ execute_cse_sincos_1): Likewise.
+ * tree-tailcall.c (adjust_accumulator_values,
+ adjust_return_value): Likewise.
+ * tree-vect-patterns.c (vect_pattern_recog_1): Likewise.
+ * tree-vect-transform.c (vect_create_data_ref_ptr,
+ bump_vector_ptr, vect_init_vector, get_initial_def_for_induction,
+ vect_create_epilog_for_reduction, vectorizable_reduction,
+ vectorizable_call, vectorizable_conversion,
+ vectorizable_assignment, vectorizable_operation,
+ vectorizable_type_demotion, vect_gen_widened_results_half,
+ vect_permute_store_chain, vectorizable_store,
+ vect_setup_realignment, vect_permute_load_chain,
+ vectorizable_load, vectorizable_condition,
+ vect_create_cond_for_align_checks): Likewise.
+ * tree-vrp.c (build_assert_expr_for): Likewise.
+
2007-03-08 Ian Lance Taylor <iant@google.com>
* tree-vrp.c: Include "intl.h".
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.