https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14179
--- Comment #80 from Jason Merrill <jason at gcc dot gnu.org> --- (In reply to Richard Biener from comment #77) > So the "low hanging fruit" remaining is reshape_init_array copying the whole > array even if not necessary. > > INTEGER_CSTs still account for most of the memory use (200MB) apart from C++ > preprocessor tokens (530MB) and the actual array of tree pointers for the > constructors (2x 130MB at peak). Still true, plus location wrappers. I think I'll look at turning off location wrappers in the initializer for a large array. Significant lines from -fmem-report: GGC memory Leak Garbage Freed Overhead Times -------------------------------------------------------------------------------------------------------------------------------------------- cp/parser.c:23438 (cp_parser_initializer_list) 0 : 0.0% 128M: 16.7% 128M: 9.1% 160 : 0.1% 22 cp/parser.c:657 (cp_lexer_new_main) 0 : 0.0% 0 : 0.0% 511M: 36.3% 72 : 0.1% 9 tree.c:14891 (maybe_wrap_with_location) 0 : 0.0% 511M: 66.7% 0 : 0.0% 0 : 0.0% 15M hash-table.h:802 (expand) 0 : 0.0% 0 : 0.0% 511M: 36.4% 1616 : 1.4% 17 cp/decl.c:6021 (reshape_init_array_1) 0 : 0.0% 128M: 16.7% 128M: 9.1% 160 : 0.1% 22 tree-inline.c:5499 (copy_tree_r) 128M: 28.4% 0 : 0.0% 0 : 0.0% 8 : 0.0% 1 hash-table.h:802 (expand) 128M: 28.4% 0 : 0.0% 127M: 9.1% 648 : 0.6% 13 tree.c:1615 (wide_int_to_tree_1) 191M: 42.7% 240 : 0.0% 0 : 0.0% 0 : 0.0% 8191k