C++ PATCH: Reduce memory usage when inlining
Mark Mitchell
mark@codesourcery.com
Sun Apr 30 11:02:00 GMT 2000
>>>>> "graham" == graham <grahams@rcp.co.uk> writes:
graham> Mark
graham> This patch triggers an abort on i686-linux when
graham> bootstrapping using "-O3 -mcpu=pentiumpro
graham> -march=pentiumpro". The abort occurs when compiling
graham> libstdc++/vararray.cc (i.e. v2 libstdc++)
graham> The abort is the one at at the end of emit_move_insn_1()
graham> routine in expr.c
graham> I haven't investigated it other than to determine that
graham> reverting this patch allows the bootstrap to complete.
Fixed by this patch, suggested by Jason.
Thanks,
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
2000-04-30 Mark Mitchell <mark@codesourcery.com>
* optimize.c (initialize_inlined_parameters): If the parameter is
addressable, we need to make a new VAR_DECL, even if the
initializer is constant.
Index: optimize.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/optimize.c,v
retrieving revision 1.28
diff -c -p -r1.28 optimize.c
*** optimize.c 2000/04/29 00:17:06 1.28
--- optimize.c 2000/04/30 17:55:24
*************** initialize_inlined_parameters (id, args,
*** 392,398 ****
/* If the parameter is never assigned to, we may not need to
create a new variable here at all. Instead, we may be able
to just use the argument value. */
! if (TREE_READONLY (p) && !TREE_SIDE_EFFECTS (value))
{
/* Simplify the value, if possible. */
value = fold (decl_constant_value (value));
--- 392,400 ----
/* If the parameter is never assigned to, we may not need to
create a new variable here at all. Instead, we may be able
to just use the argument value. */
! if (TREE_READONLY (p)
! && !TREE_ADDRESSABLE (p)
! && !TREE_SIDE_EFFECTS (value))
{
/* Simplify the value, if possible. */
value = fold (decl_constant_value (value));
More information about the Gcc-patches
mailing list