Commit d34cb6a1 by Jan Hubicka Committed by Jan Hubicka

Partial fix PR c++/12850

	Partial fix PR c++/12850
	* cgraphunit.c (cgraph_finalize_function): Always ggc_collect when
	at zero nest level.

	* decl2.c (mark_used): Do not proactively instantiate templates
	when compiling in unit-at-a-time or not optimizing.
	* optimize.c (maybe_clone_body): Do not increase function depth.

From-SVN: r75823
parent c9513590
2004-01-14 Jan Hubicka <jh@suse.cz> 2004-01-14 Jan Hubicka <jh@suse.cz>
* c-common.c (c_estimate_num_insns_1): Fix bug in MODIFY_EXPR Partial fix PR c++/12850
cost estimation. * cgraphunit.c (cgraph_finalize_function): Always ggc_collect when
* expr.c (MOVE_RATIO, CLEAR_RATIO): Move to ... at zero nest level.
* expr.h (MOVE_RATIO, CLEAR_RATIO): ... here.
2004-01-13 Bernardo Innocenti <bernie@develer.com> 2004-01-13 Bernardo Innocenti <bernie@develer.com>
......
...@@ -219,7 +219,10 @@ cgraph_finalize_function (tree decl, bool nested) ...@@ -219,7 +219,10 @@ cgraph_finalize_function (tree decl, bool nested)
/* If not unit at a time, go ahead and emit everything we've found /* If not unit at a time, go ahead and emit everything we've found
to be reachable at this time. */ to be reachable at this time. */
if (!nested) if (!nested)
cgraph_assemble_pending_functions (); {
if (!cgraph_assemble_pending_functions ())
ggc_collect ();
}
/* If we've not yet emitted decl, tell the debug info about it. */ /* If we've not yet emitted decl, tell the debug info about it. */
if (!TREE_ASM_WRITTEN (decl)) if (!TREE_ASM_WRITTEN (decl))
......
2004-01-14 Jan Hubicka <jh@suse.cz>
Partial fix to PR c++/12850
* decl2.c (mark_used): Do not proactively instantiate templates
when compiling in unit-at-a-time or not optimizing.
* optimize.c (maybe_clone_body): Do not increase function depth.
2004-01-13 Giovanni Bajo <giovannibajo@gcc.gnu.org> 2004-01-13 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/13474 PR c++/13474
......
...@@ -2580,6 +2580,7 @@ finish_file (void) ...@@ -2580,6 +2580,7 @@ finish_file (void)
/* If there are templates that we've put off instantiating, do /* If there are templates that we've put off instantiating, do
them now. */ them now. */
instantiate_pending_templates (); instantiate_pending_templates ();
ggc_collect ();
/* Write out virtual tables as required. Note that writing out /* Write out virtual tables as required. Note that writing out
the virtual table for a template class may cause the the virtual table for a template class may cause the
...@@ -3012,8 +3013,14 @@ mark_used (tree decl) ...@@ -3012,8 +3013,14 @@ mark_used (tree decl)
However, if instantiating this function might help us mark However, if instantiating this function might help us mark
the current function TREE_NOTHROW, we go ahead and the current function TREE_NOTHROW, we go ahead and
instantiate it now. */ instantiate it now.
This is not needed for unit-at-a-time since we reorder the functions
in topological order anyway.
*/
defer = (!flag_exceptions defer = (!flag_exceptions
|| flag_unit_at_a_time
|| !optimize
|| TREE_CODE (decl) != FUNCTION_DECL || TREE_CODE (decl) != FUNCTION_DECL
/* If the called function can't throw, we don't need to /* If the called function can't throw, we don't need to
generate its body to find that out. */ generate its body to find that out. */
......
...@@ -129,11 +129,6 @@ maybe_clone_body (tree fn) ...@@ -129,11 +129,6 @@ maybe_clone_body (tree fn)
/* Emit the DWARF1 abstract instance. */ /* Emit the DWARF1 abstract instance. */
(*debug_hooks->deferred_inline_function) (fn); (*debug_hooks->deferred_inline_function) (fn);
/* Our caller does not expect collection to happen, which it might if
we decide to compile the function to rtl now. Arrange for a new
gc context to be created if so. */
function_depth++;
/* We know that any clones immediately follow FN in the TYPE_METHODS /* We know that any clones immediately follow FN in the TYPE_METHODS
list. */ list. */
for (clone = TREE_CHAIN (fn); for (clone = TREE_CHAIN (fn);
...@@ -253,8 +248,6 @@ maybe_clone_body (tree fn) ...@@ -253,8 +248,6 @@ maybe_clone_body (tree fn)
pop_from_top_level (); pop_from_top_level ();
} }
function_depth--;
/* We don't need to process the original function any further. */ /* We don't need to process the original function any further. */
return 1; return 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment