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: Sat, 28 May 2005 02:35:10 +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: 24816k -> 24808k
Peak memory use before GGC: 9651k -> 9642k
Peak memory use after GGC: 8964k -> 8954k
Maximum of released memory in single GGC run: 2791k -> 2790k
Garbage: 42453k -> 42235k
Leak: 6723k -> 6693k
Overhead: 5933k -> 5844k
GGC runs: 330 -> 329
comparing combine.c compilation at -O1 level:
Overall memory needed: 27624k -> 27596k
Peak memory use before GGC: 9178k -> 9148k
Peak memory use after GGC: 8748k -> 8709k
Maximum of released memory in single GGC run: 2204k -> 2203k
Garbage: 63519k -> 63060k
Leak: 7089k -> 7074k
Overhead: 7709k -> 7554k
GGC runs: 525 -> 522
comparing combine.c compilation at -O2 level:
Overall memory needed: 24936k -> 24800k
Peak memory use before GGC: 18412k -> 18268k
Peak memory use after GGC: 18224k -> 18081k
Maximum of released memory in single GGC run: 2522k -> 2523k
Garbage: 88851k -> 88346k
Leak: 7039k
Overhead: 11047k -> 10878k
GGC runs: 484
comparing combine.c compilation at -O3 level:
Amount of memory still referenced at the end of compilation increased from 7112k to 7128k, overall 0.22%
Overall memory needed: 25212k -> 25108k
Peak memory use before GGC: 18422k -> 18279k
Peak memory use after GGC: 18224k -> 18081k
Maximum of released memory in single GGC run: 3093k
Garbage: 118585k -> 117897k
Leak: 7112k -> 7128k
Overhead: 14662k -> 14424k
GGC runs: 538
comparing insn-attrtab.c compilation at -O0 level:
Overall memory needed: 85596k -> 85588k
Peak memory use before GGC: 73853k -> 73383k
Peak memory use after GGC: 45357k -> 45353k
Maximum of released memory in single GGC run: 37612k
Garbage: 154701k -> 153233k
Leak: 11537k -> 11531k
Overhead: 20070k -> 19577k
GGC runs: 268
comparing insn-attrtab.c compilation at -O1 level:
Overall memory needed: 101424k -> 101136k
Peak memory use before GGC: 77259k -> 76428k
Peak memory use after GGC: 66358k -> 65583k
Maximum of released memory in single GGC run: 37102k -> 37095k
Garbage: 307222k -> 304151k
Leak: 11599k -> 11592k
Overhead: 37680k -> 36643k
GGC runs: 385 -> 384
comparing insn-attrtab.c compilation at -O2 level:
Overall memory needed: 153684k -> 153896k
Peak memory use before GGC: 120533k -> 119643k
Peak memory use after GGC: 94158k -> 93012k
Maximum of released memory in single GGC run: 32951k
Garbage: 410850k -> 407687k
Leak: 11434k
Overhead: 51079k -> 49973k
GGC runs: 306
comparing insn-attrtab.c compilation at -O3 level:
Overall memory needed: 153644k -> 153916k
Peak memory use before GGC: 120535k -> 119646k
Peak memory use after GGC: 94160k -> 93014k
Maximum of released memory in single GGC run: 32951k
Garbage: 411640k -> 408475k
Leak: 11455k
Overhead: 51203k -> 50095k
GGC runs: 312
comparing Gerald's testcase PR8361 compilation at -O0 level:
Overall memory needed: 127372k -> 127316k
Peak memory use before GGC: 103134k -> 103067k
Peak memory use after GGC: 102097k -> 102045k
Maximum of released memory in single GGC run: 20902k -> 21522k
Garbage: 248225k -> 247319k
Leak: 53785k
Overhead: 43154k -> 42785k
GGC runs: 347 -> 346
comparing Gerald's testcase PR8361 compilation at -O1 level:
Overall memory needed: 121732k -> 121424k
Peak memory use before GGC: 113021k -> 112510k
Peak memory use after GGC: 100997k -> 100687k
Maximum of released memory in single GGC run: 20054k -> 20025k
Garbage: 667022k -> 660607k
Leak: 58897k
Overhead: 85519k -> 83365k
GGC runs: 518
comparing Gerald's testcase PR8361 compilation at -O2 level:
Overall memory needed: 121704k -> 121400k
Peak memory use before GGC: 113021k -> 112510k
Peak memory use after GGC: 100997k -> 100687k
Maximum of released memory in single GGC run: 20053k -> 20025k
Garbage: 772585k -> 766088k
Leak: 59593k
Overhead: 104718k -> 102513k
GGC runs: 612 -> 613
comparing Gerald's testcase PR8361 compilation at -O3 level:
Overall memory needed: 125540k -> 124356k
Peak memory use before GGC: 115802k -> 115252k
Peak memory use after GGC: 102656k -> 102513k
Maximum of released memory in single GGC run: 21453k -> 21385k
Garbage: 829727k -> 822654k
Leak: 60842k
Overhead: 111202k -> 108816k
GGC runs: 611
Head of the ChangeLog is:
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog 2005-05-27 21:34:14.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog 2005-05-28 01:30:58.000000000 +0000
@@ -1,3 +1,81 @@
+2005-05-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * config/mips/mips-protos.h (mips_declare_object): Add printf
+ attribute.
+ * config/mips/mips.c (mips_declare_object_name): Fix format
+ argument.
+
+2005-05-27 Roger Sayle <roger@eyesopen.com>
+
+ * reg-stack.c (compensate_edge): Remove original prototype.
+ (propagate_stack): New function to copy the stack layout
+ at the start of a basic block from the layout at the end of
+ one of its predecessors.
+ (compensate_edge): Assume that both source and destination
+ blocks have already had their stack layouts defined.
+ (compensate_edges): Traverse all non-entry edges in the CFG
+ and call compensate_edge on each in turn.
+ (convert_regs_1): Change return type to void. Call
+ propagate_stack instead of compensate_edge.
+ (convert_regs_2): Change return type to void. Update call
+ to convert_regs_1 to ignore the (now void) return value.
+ (convert_regs): Update calls to convert_regs_2 to ignore
+ the (now void) return value. After all the basic blocks have
+ been processed, call compensate_edges to actually emit new
+ insns.
+ (reg_to_stack): Initialize the aux info for each basic block
+ with FOR_EACH_BB instead of which FOR_EACH_BB_REVERSE.
+
+2005-05-28 Jan Hubicka <jh@suse.cz>
+
+ * except.c (can_throw_internal_1, can_throw_external_1): Add
+ "is_resx" argument.
+ (can_throw_external, can_throw_internal): Bring into sync wrt
+ dealing resx.
+ * except.h (can_throw_internal_1, can_throw_external_1): Update
+ prototype.
+ * tree-eh.c (tree_can_throw_internal, tree_can_throw_external):
+ Deal properly with resx.
+
+2005-05-27 Kazu Hirata <kazu@cs.umass.edu>
+
+ * basic-block.h (basic_block_def): Add phi_nodes and
+ predictions. Remove tree_annotations.
+ * predict.c (tree_predicted_by_p, tree_predict_edge,
+ combine_predictions_for_bb): Adjust references to predictions.
+ * tree-cfg.c (init_empty_tree_cfg, create_bb): Don't call
+ create_block_annotation.
+ (create_block_annotation, free_blocks_annotatios,
+ clear_blocks_annotations): Remove.
+ (dump_cfg_stats): Don't print out the memory spent on
+ bb_ann_d.
+ (delete_tree_cfg_annotations): Don't call free_blocks_annotations.
+ * tree-flow-inline.h (bb_ann): Remove.
+ (phi_nodes, set_phi_nodes): Update references to phi_nodes.
+ * tree-flow.h (bb_ann_d): Remove.
+ * tree-if-conv.c (process_phi_nodes): Update a reference to
+ phi_nodes.
+ * tree-phinodes.c (reserve_phi_args_for_new_edge,
+ create_phi_node, remove_phi_node): Likewise.
+ * tree-pretty-print.c (dump_generic_bb_buff): Don't call bb_ann.
+ * tree-ssa-dom.c (threaded_blocks): New.
+ (tree_ssa_dominator_optimize): Initialize, clear, and free
+ threaded_blocks. Update a call to thread_through_all_blocks.
+ (thread_across_edge): Use threaded_blocks instead of setting
+ incoming_edge_threaded.
+ * tree-ssa-threadupdate.c (threaded_through_all_blocks): Take
+ a bitmap of blocks that are threaded through.
+ * tree.h: Move the prototype of threaded_through_blocks to
+ tree-flow.h.
+
+ * domwalk.c (walk_dominator_tree, init_walk_dominator_tree,
+ fini_walk_dominator_tree): Use VEC instead of VARRAY.
+ * domwalk.h (dom_walk_data): Change the type of
+ block_data_stack and free_block_data to VEC(void_p,heap)*.
+ * tree-ssa-dse.c (dse_initialize_block_local_data,
+ dse_optimize_stmt, dse_record_phis, dse_finalize_block): Use
+ VEC instead of VARRAY.
+
2005-05-27 Jan Hubicka <jh@suse.cz>
* cgraph.c: Include tree-gimple.h
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp 2005-05-27 18:01:00.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog 2005-05-28 01:30:59.000000000 +0000
@@ -1,3 +1,26 @@
+2005-05-27 Roger Sayle <roger@eyesopen.com>
+ Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ * cp-tree.def (UNARY_PLUS_EXPR): New C++ unary tree code.
+ * parser.c (cp_parser_unary_expression): Use UNARY_PLUS_EXPR instead
+ of CONVERT_EXPR.
+ (cp_parser_unary_expression): Likewise.
+ * typeck.c (build_unary_op): Likewise.
+ * call.c (add_builtin_candidate, build_new_op): Likewise.
+ * error.c (dump_expr): Likewise.
+ * pt.c (tsubst_copy, tsubst_copy_and_build): Likewise.
+ * decl.c (ambi_op_p, grok_op_properties): Likewise.
+ * dump.c (dump_op): Likewise.
+ * lex.c (init_operators): Likewise.
+ * operators.def ("+"): Likewise.
+ * cp-gimplify.c (cp_gimplify_expr): Handle UNARY_PLUS_EXPR like a
+ conversion, if the result and argument types differ.
+ * tree.c (fold_if_not_in_template): Fold UNARY_PLUS_EXPR much
+ like a NOP_EXPR when !processing_template_decl.
+
+ * cxx-pretty-print.c (pp_cxx_cast_expression): Prototype.
+ (pp_cxx_unary_expression): Handle new UNARY_PLUS_EXPR tree code.
+
2005-05-27 Nathan Sidwell <nathan@codesourcery.com>
PR c++/21455
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.