This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH for save_tree_status
- To: egcs-patches at cygnus dot com
- Subject: PATCH for save_tree_status
- From: Mark Mitchell <mark at markmitchell dot com>
- Date: Wed, 24 Feb 1999 13:41:26 -0800
- Reply-to: mark at markmitchell dot com
The save_tree_status function mishandles the case where the context
of the new function is NULL, but we're at global scope. It would be
useful to handle this case, so that we can use save_tree_status during
template instantiation in C++ front-end.
This change has been bootstrapped/checked on x86-linux-gnu.
Would someone care to approve this patch?
Thanks,
--
Mark Mitchell mark@markmitchell.com
Mark Mitchell Consulting http://www.markmitchell.com
Wed Feb 24 13:38:39 1999 Mark Mitchell <mark@markmitchell.com>
* tree.c (save_tree_status): Don't treat functions with no context
as nested.
Index: tree.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/tree.c,v
retrieving revision 1.59
diff -c -p -r1.59 tree.c
*** tree.c 1999/02/17 08:04:28 1.59
--- tree.c 1999/02/24 20:59:04
*************** save_tree_status (p, context)
*** 345,351 ****
p->rtl_obstack = rtl_obstack;
p->inline_obstacks = inline_obstacks;
! if (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. */
--- 345,351 ----
p->rtl_obstack = rtl_obstack;
p->inline_obstacks = inline_obstacks;
! 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. */