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: 24917k -> 24985k
    Peak memory use before GGC: 9599k -> 9600k
    Peak memory use after GGC: 8946k -> 8947k
    Maximum of released memory in single GGC run: 2736k
    Garbage: 40098k -> 40113k
    Leak: 6709k -> 6665k
    Overhead: 5789k -> 5744k
    GGC runs: 317

comparing combine.c compilation at -O1 level:
    Overall memory needed: 26824k
    Peak memory use before GGC: 17367k -> 17368k
    Peak memory use after GGC: 17184k -> 17185k
    Maximum of released memory in single GGC run: 2373k -> 2372k
    Garbage: 60956k -> 60905k
    Leak: 6890k -> 6848k
    Overhead: 7649k -> 7552k
    GGC runs: 389

comparing combine.c compilation at -O2 level:
    Overall memory needed: 26824k
    Peak memory use before GGC: 17370k
    Peak memory use after GGC: 17184k -> 17185k
    Maximum of released memory in single GGC run: 2454k
    Garbage: 77599k -> 77561k
    Leak: 6977k -> 6933k
    Overhead: 10058k -> 9984k
    GGC runs: 457 -> 456

comparing combine.c compilation at -O3 level:
    Overall memory needed: 26824k
    Peak memory use before GGC: 18370k -> 18371k
    Peak memory use after GGC: 18000k -> 18001k
    Maximum of released memory in single GGC run: 3525k -> 3521k
    Garbage: 108316k -> 108294k
    Leak: 7055k -> 7011k
    Overhead: 13616k -> 13562k
    GGC runs: 509

comparing insn-attrtab.c compilation at -O0 level:
  Amount of produced GGC garbage increased from 146440k to 146698k, overall 0.18%
    Overall memory needed: 80928k -> 80920k
    Peak memory use before GGC: 69473k -> 69474k
    Peak memory use after GGC: 45011k -> 45012k
    Maximum of released memory in single GGC run: 36247k
    Garbage: 146440k -> 146698k
    Leak: 10101k -> 9817k
    Overhead: 19797k -> 19752k
    GGC runs: 251 -> 252

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 112108k -> 112084k
    Peak memory use before GGC: 94461k -> 94462k
    Peak memory use after GGC: 83560k -> 83561k
    Maximum of released memory in single GGC run: 32588k
    Garbage: 296187k -> 296191k
    Leak: 10079k -> 10035k
    Overhead: 36751k -> 36706k
    GGC runs: 247

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 125656k -> 125652k
    Peak memory use before GGC: 111820k
    Peak memory use after GGC: 83479k -> 83477k
    Maximum of released memory in single GGC run: 32177k -> 32178k
    Garbage: 381027k -> 381030k
    Leak: 10180k -> 10136k
    Overhead: 48262k -> 48217k
    GGC runs: 274

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 125700k -> 125708k
    Peak memory use before GGC: 111839k -> 111846k
    Peak memory use after GGC: 83498k -> 83502k
    Maximum of released memory in single GGC run: 32502k -> 32503k
    Garbage: 381639k -> 381635k
    Leak: 10185k -> 10141k
    Overhead: 48414k -> 48372k
    GGC runs: 277

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 118392k -> 118388k
    Peak memory use before GGC: 95142k -> 95145k
    Peak memory use after GGC: 94194k -> 94197k
    Maximum of released memory in single GGC run: 20460k -> 20461k
    Garbage: 223578k -> 223593k
    Leak: 49201k -> 49156k
    Overhead: 36724k -> 36686k
    GGC runs: 369 -> 370

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 105516k -> 105520k
    Peak memory use before GGC: 95271k -> 95274k
    Peak memory use after GGC: 93196k -> 93199k
    Maximum of released memory in single GGC run: 20343k
    Garbage: 568767k -> 568771k
    Leak: 55023k -> 54981k
    Overhead: 67262k -> 67216k
    GGC runs: 522

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 106048k -> 106080k
    Peak memory use before GGC: 95271k -> 95274k
    Peak memory use after GGC: 93197k -> 93200k
    Maximum of released memory in single GGC run: 20342k -> 20343k
    Garbage: 650879k -> 650831k
    Leak: 55804k -> 55762k
    Overhead: 78204k -> 78145k
    GGC runs: 585

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 109272k -> 109284k
    Peak memory use before GGC: 96739k -> 96742k
    Peak memory use after GGC: 94274k -> 94277k
    Maximum of released memory in single GGC run: 20839k
    Garbage: 709878k -> 709815k
    Leak: 57066k -> 57024k
    Overhead: 83050k -> 83016k
    GGC runs: 594 -> 593

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2005-12-01 18:35:35.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2005-12-02 04:54:42.000000000 +0000
@@ -1,3 +1,96 @@
+2005-12-01  Roger Sayle  <roger@eyesopen.com>
+
+	* tree.h (TREE_OVERFLOW): Make this flag/predicate specific to
+	constant nodes, i.e. INTEGER_CST, REAL_CST, etc...
+	* tree-vrp.c (compare_values): Only check TREE_OVERFLOW for
+	integer constant comparisons.
+
+2005-12-02  Jon Grimm  <jgrimm2@us.ibm.com>
+	    Janis Johnson  <janis187@us.ibm.com>
+	    David Edelsohn  <dje@watson.ibm.com>
+	    Ben Elliston  <bje@au.ibm.com>
+
+	* dfp.h, dfp.c: New files.
+	* Makefile.in (DECNUM, DECNUMINC, LIBDECNUMBER): New variables.
+	(DECNUM_H): Likewise.
+	(LIBDEPS, LIBS, BACKEND): Append $(LIBDECNUMBER).
+	(INCLUDES): Append $(DECNUMINC).
+	(OBJS-common): Add dfp.o.
+	(dfp.o): New rule.
+	* real.h (EXP_BITS): Pinch one bit to ..
+	(struct real_value): Add decimal field.
+	(real_format): Change table size, update documentation.
+	(REAL_MODE_FORMAT): Update for to handle float, decimal float.
+	(real_from_string3): Declare.
+	(decimal_single_format): Declare.
+	(decimal_double_format): Declare.
+	(decimal_quad_format): Declare.
+	(REAL_VALUE_TO_TARGET_DECIMAL32): New.
+	(REAL_VALUE_TO_TARGET_DECIMAL64): New.
+	(REAL_VALUE_TO_TARGET_DECIMAL128): New.
+	* real.c: Include dfp.h.
+	(normalize): Early return for decimal floats.
+	(do_add): Zero decimal field.
+	(do_compare): Call do_decimal_compare for decimal floats.
+	(do_fix_trunc): Likewise, call decimal_do_fix_trunc.
+	(real_arithmetic): Call decimal_real_arithmetic for decimal
+	floating point operands.
+	(real_identical): If a and b are of differing radix, return false.
+	(real_to_integer): Call decimal_real_to_integer if the value is a
+	decimal float.
+	(real_to_integer2): Likewise, call decimal_real_to_integer2.
+	(real_to_decimal): Likewise, call decimal_real_to_decimal.
+	(real_to_hexadecimal): Place "N/A" in the return string for
+	decimal float.
+	(real_from_string3): New variant, given a mode.
+	(real_maxval): Use decimal_real_maxval for decimal floats.
+	(round_for_format): Use decimal_round_for_format for decimals.
+	(real_convert): Use decimal_real_convert where appropriate.
+	(significand_size): Handle base 10.
+	(encode_decimal_single, decode_decimal_single,
+	encode_decimal_double, decode_decimal_double, encode_decimal_quad,
+	decode_decimal_quad): New functions.
+	(decimal_single_format): New.
+	(decimal_double_format): New.
+	(decimal_quad_format): New.
+	* machmode.def: Add SD, DD and TD decimal floating point modes.
+	* machmode.h (FLOAT_MODE_P, SCALAR_FLOAT_MODE_P, MODES_WIDEN_P):
+	Include MODE_DECIMAL_FLOAT.
+	(DECIMAL_FLOAT_MODE_P): New.
+	* mode-classes.def (MODE_DECIMAL_FLOAT): New mode class.
+	* genmodes.c (struct mode_data): Add counter field.
+	(struct mode_data): Update comment for format.
+	(blank_mode): Initialise counter field.
+	(new_mode): Increment counter field for each mode defined.
+	(complete_mode): Handle MODE_DECIMAL_FLOAT, update check for mode
+	using a format.
+	(make_complex_modes): Handle modes containing `D'.
+	(DECIMAL_FLOAT_MODE, FRACTIONAL_DECIMAL_FLOAT_MODE): New.
+	(make_decimal_float_mode): New.
+	(reset_float_format): Handle MODE_DECIMAL_FLOAT.
+	(cmp_modes): Compare counter field if other characteristics
+	similar.
+	(emit_real_format_for_mode): Support formats for decimal floats.
+	* doc/rtl.texi (Machine Modes): Document SD, DD and TDmodes.
+	Document MODE_DECIMAL_FLOAT.
+
+2005-12-02  Alan Modra  <amodra@bigpond.net.au>
+
+	* simplify-rtx.c (simplify_plus_minus): Do simplify constants.
+	Delete dead code.
+
+2005-12-01  Richard Henderson  <rth@redhat.com>
+
+	* optabs.c (expand_vec_cond_expr): Use EXPAND_NORMAL.
+
+2005-12-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+	* builtins.def (BUILT_IN_PUTC, BUILT_IN_PUTC_UNLOCKED): New.
+
+	* config/pa/pa.c (pa_init_builtins): If we detect
+	DONT_HAVE_FPUTC_UNLOCKED, set builtin fputc_unlocked to
+	putc_unlocked.
+
 2005-12-01  Richard Guenther  <rguenther@suse.de>
 
 	* fold-const.c (fold_binary): Use fold_build2, not
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2005-11-30 21:57:29.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2005-12-02 04:54:41.000000000 +0000
@@ -1,3 +1,19 @@
+2005-12-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+
+	* parser.c (cp_parser_make_typename_type): Call make_typename_type
+	with tf_none instead of magic value 0.
+	(cp_parser_explicit_instantiation): Call do_type_instantiation
+	with tf_error instead of magic value 1.
+	(cp_parser_elaborated_type_specifier): Call make_typename_type
+	with tf_error instead of magic value 1.
+	(cp_parser_class_name): Likewise.
+	(cp_parser_lookup_name): Likewise.
+
+2005-12-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+
+	* parser.c (cp_parser_declaration): Set token2.type to CPP_EOF,
+	not RID_MAX.
+
 2005-11-30  Jason Merrill  <jason@redhat.com>
 
 	PR c++/21123


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]