summaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-03-02 07:42:49 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-03-02 07:42:49 +0000
commit0942a7e14e7799bd62e996ae4ee136a16a0a79f3 (patch)
tree7bf404b613c64710c6f445ee663df88c55ffb7fd /gcc/tree.c
parentfaef3f64320761a5ba4f308fd567c319c50dde01 (diff)
downloadgcc-0942a7e14e7799bd62e996ae4ee136a16a0a79f3.tar.gz
* tree.c (save_tree_status): Don't treat functions with no context
as nested. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25534 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 80b67959882..1114ec34716 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -320,8 +320,11 @@ gcc_obstack_init (obstack)
(void (*) ()) OBSTACK_CHUNK_FREE);
}
-/* Save all variables describing the current status into the structure *P.
- This is used before starting a nested function.
+/* Save all variables describing the current status into the structure
+ *P. This function is called whenever we start compiling one
+ function in the midst of compiling another. For example, when
+ compiling a nested function, or, in C++, a template instantiation
+ that is required by the function we are currently compiling.
CONTEXT is the decl_function_context for the function we're about to
compile; if it isn't current_function_decl, we have to play some games. */
@@ -345,7 +348,7 @@ save_tree_status (p, context)
p->rtl_obstack = rtl_obstack;
p->inline_obstacks = inline_obstacks;
- if (context == current_function_decl)
+ if (current_function_decl && context == current_function_decl)
/* Objects that need to be saved in this function can be in the nonsaved
obstack of the enclosing function since they can't possibly be needed
once it has returned. */