aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 0d3a776..1184c6b 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -3359,12 +3359,9 @@ build_type_attribute_variant (ttype, attribute)
if ( ! attribute_list_equal (TYPE_ATTRIBUTES (ttype), attribute))
{
register int hashcode;
- register struct obstack *ambient_obstack = current_obstack;
tree ntype;
- if (ambient_obstack != &permanent_obstack)
- current_obstack = TYPE_OBSTACK (ttype);
-
+ push_obstacks (TYPE_OBSTACK (ttype), TYPE_OBSTACK (ttype));
ntype = copy_node (ttype);
TYPE_POINTER_TO (ntype) = 0;
@@ -3400,12 +3397,7 @@ build_type_attribute_variant (ttype, attribute)
ntype = type_hash_canon (hashcode, ntype);
ttype = build_qualified_type (ntype, TYPE_QUALS (ttype));
-
- /* We must restore the current obstack after the type_hash_canon call,
- because type_hash_canon calls type_hash_add for permanent types, and
- then type_hash_add calls oballoc expecting to get something permanent
- back. */
- current_obstack = ambient_obstack;
+ pop_obstacks ();
}
return ttype;