aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1999-07-15 15:40:59 +0000
committerJim Wilson <wilson@gcc.gnu.org>1999-07-15 08:40:59 -0700
commite500a90e22732edac168b9d9986ae7b08d3f2391 (patch)
tree7a998371a7345d976e236ab8c7fcc8ff8cb0350f /gcc/tree.c
parente3f5cc86f875375ac87d4cdaac62f82ab4428295 (diff)
downloadgcc-e500a90e22732edac168b9d9986ae7b08d3f2391.zip
gcc-e500a90e22732edac168b9d9986ae7b08d3f2391.tar.gz
gcc-e500a90e22732edac168b9d9986ae7b08d3f2391.tar.bz2
Fix winsup build failure reported by Chris Faylor.
* tree.c (build_type_attribute_variant): Move current_obstack restore after build_qualified_type call. From-SVN: r28116
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index b61c115..5e29d2f 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -3300,7 +3300,6 @@ build_type_attribute_variant (ttype, attribute)
current_obstack = TYPE_OBSTACK (ttype);
ntype = copy_node (ttype);
- current_obstack = ambient_obstack;
TYPE_POINTER_TO (ntype) = 0;
TYPE_REFERENCE_TO (ntype) = 0;
@@ -3335,6 +3334,12 @@ 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;
}
return ttype;