aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-09-08 08:56:27 -0700
committerRichard Henderson <rth@gcc.gnu.org>2003-09-08 08:56:27 -0700
commitc1f927e84ec73debafbc0114cc4d81abd1b27ae7 (patch)
treead932cb4dec8a82eb9fd686cb0a6c341596f0816 /gcc/cp/pt.c
parent7f14bbe68f1fac27349b5154730aeb2e23e97dfa (diff)
downloadgcc-c1f927e84ec73debafbc0114cc4d81abd1b27ae7.zip
gcc-c1f927e84ec73debafbc0114cc4d81abd1b27ae7.tar.gz
gcc-c1f927e84ec73debafbc0114cc4d81abd1b27ae7.tar.bz2
c-decl.c (c_expand_body_1): Push and pop function context here.
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. From-SVN: r71208
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 8169cf3..bb93047 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -10730,10 +10730,14 @@ instantiate_decl (tree d, int defer_ok)
timevar_push (TV_PARSE);
- /* We may be in the middle of deferred access check. Disable
- it now. */
+ /* We may be in the middle of deferred access check. Disable it now. */
push_deferring_access_checks (dk_no_deferred);
+ /* 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++;
+
/* Set TD to the template whose DECL_TEMPLATE_RESULT is the pattern
for the instantiation. */
td = template_for_substitution (d);
@@ -10978,6 +10982,7 @@ out:
input_location = saved_loc;
pop_deferring_access_checks ();
pop_tinst_level ();
+ function_depth--;
timevar_pop (TV_PARSE);