From e500a90e22732edac168b9d9986ae7b08d3f2391 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Thu, 15 Jul 1999 15:40:59 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 5 +++++ gcc/tree.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3a19f31f4d6..7c986ba33dc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Thu Jul 15 15:40:09 1999 Jim Wilson + + * tree.c (build_type_attribute_variant): Move current_obstack restore + after build_qualified_type call. + 1999-07-15 Mark Mitchell * configure.in: Use t-iris6, even with GNU LD. diff --git a/gcc/tree.c b/gcc/tree.c index b61c11587ec..5e29d2f9115 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;