diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1998-05-06 02:40:36 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1998-05-05 22:40:36 -0400 |
commit | 73c9f270181676873dcacaa7629fea4ad2b9c5d3 (patch) | |
tree | bb82d8c10cb61fd53cb36529e7a950106fe4284d | |
parent | 15ebe47d89fc04267f3b232556ebedd6e19d3bcc (diff) | |
download | gcc-73c9f270181676873dcacaa7629fea4ad2b9c5d3.zip gcc-73c9f270181676873dcacaa7629fea4ad2b9c5d3.tar.gz gcc-73c9f270181676873dcacaa7629fea4ad2b9c5d3.tar.bz2 |
tree.c (perm_manip): Also regenerate the RTL of an extern.
* tree.c (perm_manip): Also regenerate the RTL of an extern.
(copy_to_permanent): Use end_temporary_allocation.
From-SVN: r19560
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/tree.c | 24 |
2 files changed, 18 insertions, 11 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6b34102..ce8d770 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +Wed May 6 02:33:39 1998 Jason Merrill <jason@yorick.cygnus.com> + + * tree.c (perm_manip): Also regenerate the RTL of an extern. + (copy_to_permanent): Use end_temporary_allocation. + Tue May 5 23:54:04 1998 Jason Merrill <jason@yorick.cygnus.com> * init.c (expand_vec_init): The initialization of each array diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 3b4ca22..fc9fd37 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1685,10 +1685,19 @@ perm_manip (t) { if (TREE_PERMANENT (t)) return t; + /* Support `void f () { extern int i; A<&i> a; }' */ if ((TREE_CODE (t) == VAR_DECL || TREE_CODE (t) == FUNCTION_DECL) && TREE_PUBLIC (t)) - return copy_node (t); + { + t = copy_node (t); + + /* copy_rtx won't make a new SYMBOL_REF, so call make_decl_rtl again. */ + DECL_RTL (t) = 0; + make_decl_rtl (t, NULL_PTR, 1); + + return t; + } return NULL_TREE; } @@ -1699,22 +1708,15 @@ tree copy_to_permanent (t) tree t; { - register struct obstack *ambient_obstack = current_obstack; - register struct obstack *ambient_saveable_obstack = saveable_obstack; - register struct obstack *ambient_expression_obstack = expression_obstack; - if (t == NULL_TREE || TREE_PERMANENT (t)) return t; - saveable_obstack = &permanent_obstack; - current_obstack = saveable_obstack; - expression_obstack = saveable_obstack; + push_obstacks_nochange (); + end_temporary_allocation (); t = mapcar (t, perm_manip); - current_obstack = ambient_obstack; - saveable_obstack = ambient_saveable_obstack; - expression_obstack = ambient_expression_obstack; + pop_obstacks (); return t; } |