summaryrefslogtreecommitdiff
path: root/gcc/cp/optimize.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-08 15:56:27 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-08 15:56:27 +0000
commitc437b0dc4fe2c418a3b3bed02eab49e69f3c0e7a (patch)
treead932cb4dec8a82eb9fd686cb0a6c341596f0816 /gcc/cp/optimize.c
parent08a88e825fb6e00a791432bba82d7cd384f90335 (diff)
downloadgcc-c437b0dc4fe2c418a3b3bed02eab49e69f3c0e7a.tar.gz
gcc/
* c-decl.c (c_expand_body_1): Push and pop function context here. * tree-optimize.c (tree_rest_of_compilation): ... not here. Take nested argument instead of computing nesting ourselves. gcc/cp/ * decl.c (finish_function): Clear current_function_decl. * decl2.c (mark_used): Don't push/pop gc context. * optimize.c (optimize_function): Likewise. * tree.c (cp_cannot_inline_tree_fn): Likewise. * pt.c (instantiate_decl): Inc/dec function_depth instead. * semantics.c (expand_body): Update for tree_rest_of_compilation nested argument. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71208 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/optimize.c')
-rw-r--r--gcc/cp/optimize.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index 7be410e296d..bcb74e4917f 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -56,31 +56,7 @@ optimize_function (tree fn)
and (d) TARGET_ASM_OUTPUT_MI_THUNK is there to DTRT anyway. */
&& !DECL_THUNK_P (fn))
{
- /* ??? Work around GC problem. Call stack is
-
- -> instantiate_decl
- -> expand_or_defer_fn
- -> maybe_clone_body
- -> expand_body
- -> tree_rest_of_compilation
-
- which of course collects. This used to be protected by the
- "regular" nested call ggc_push_context that now lives in
- tree_rest_of_compilation.
-
- Two good fixes:
- (1) Do inlining in tree_rest_of_compilation. This is good
- in that this common optimization happens in common code.
- (2) Don't nest compilation of functions. Instead queue the
- new function to cgraph, and let it get picked up in the
- next round of "emit everything that needs emitting".
-
- For the nonce, just protect things here. */
-
- ggc_push_context ();
optimize_inline_calls (fn);
- ggc_pop_context ();
-
dump_function (TDI_inlined, fn);
}