From 65cd8f24f49eb5d9292265e74b5de0fb92d6fa62 Mon Sep 17 00:00:00 2001 From: Jeffrey A Law Date: Mon, 2 Aug 1999 05:07:23 +0000 Subject: [PATCH] tree.c (build_type_attribute_variant): Move current_obstack restore after build_qualified_type call. Thu Jul 15 15:40:09 1999 Jim Wilson * tree.c (build_type_attribute_variant): Move current_obstack restore after build_qualified_type call. Brought over from the mainline sources. Fixes spurious core dumps/aborts. From-SVN: r28385 --- gcc/ChangeLog | 4 ++++ gcc/tree.c | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 391774ce11e7..3ec8ea0679cb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -3,6 +3,10 @@ Sun Aug 1 22:46:42 1999 Jeffrey A Law (law@cygnus.com) * m68k.c (output_function_prologue): Fix typo in CPU32 case. (output_function_epilogue): Similarly. + Thu Jul 15 15:40:09 1999 Jim Wilson + * tree.c (build_type_attribute_variant): Move current_obstack restore + after build_qualified_type call. + Fri Jun 4 03:20:40 1999 J"orn Rennecke * sh.c (fixup_addr_diff_vecs): Emit braf reference label. (braf_label_ref_operand): Delete. diff --git a/gcc/tree.c b/gcc/tree.c index b61c11587ec8..5e29d2f9115b 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; -- 2.47.2