This is the mail archive of the gcc-patches@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]

[PATCH] [4.3 Regression] Fix major memory-usage regression on mainline


The variadic templates patch introduced a significant compile-time
memory usage regression on mainline. This patch fixes that regression,
and integrates a few other obvious tweaks from
http://gcc.gnu.org/ml/gcc-patches/2007-03/msg00759.html, taking our
memory usage back down below pre-variadic templates levels.

Total virtual memory used when compiling tramp3d on i686-pc-linux-gnu:
 - before variadic templates: 508714 kB
 - after variadic templates: 560518 kB
 - with this patch: 508702 kB

Tested i686-pc-linux-gnu and powerpc-apple-darwin8.8.0; no regressions.

Okay for mainline?

 Cheers,
 Doug

2007-03-13 Douglas Gregor <doug.gregor@gmail.com>

	* ptree.c (cxx_print_type): Use formatting markup for integers
	when printing template parameter index/level/orig level.
	(cxx_print_xnode): Ditto.
	* cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
	(struct template_parm_index_s): Remove the PARAMETER_PACK member.
	Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
	HOST_WIDE_INTs.
	(struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
	rather than a HOST_WIDE_INT.
	Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
	NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
	better bit-packing.
	(struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
	RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
	IN_BASE_INITIALIZER bool bitfields.
	(struct cp_declarator): Make KIND a 4-bit field. Make
	PARAMETER_PACK_P a bool bitfield just after KIND.
	* pt.c (uses_parameter_packs): Destroy the pointer set.
	(make_pack_expansion): Ditto.
	(check_for_bare_parameter_packs): Ditto.
	* name-lookup.c (push_to_top_level): Make need_pop a bool value.

Attachment: cp-mem-usage.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]