diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-04-09 08:25:26 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-04-09 08:25:26 -0400 |
commit | 46b1c39385d1b94f3adad6add99786924f3801ae (patch) | |
tree | 7eefb5917876a0f197b4b7da1892c0d97a643b29 /gcc | |
parent | 34b1b41f3b5aa456a6142b063ef93f1397ee65b2 (diff) | |
download | gcc-46b1c39385d1b94f3adad6add99786924f3801ae.zip gcc-46b1c39385d1b94f3adad6add99786924f3801ae.tar.gz gcc-46b1c39385d1b94f3adad6add99786924f3801ae.tar.bz2 |
(duplicate_decls): Put new type in same obstack as old ones, or
permanent is old ones in different obstacks.
From-SVN: r7001
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-decl.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 1e818a0..1a75fa8 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1624,6 +1624,17 @@ duplicate_decls (newdecl, olddecl) if (types_match) { + /* Make sure we put the new type in the same obstack as the old ones. + If the old types are not both in the same obstack, use the permanent + one. */ + if (TYPE_OBSTACK (oldtype) == TYPE_OBSTACK (newtype)) + push_obstacks (TYPE_OBSTACK (oldtype), TYPE_OBSTACK (oldtype)); + else + { + push_obstacks_nochange (); + end_temporary_allocation (); + } + /* Merge the data types specified in the two decls. */ if (TREE_CODE (newdecl) != FUNCTION_DECL || !DECL_BUILT_IN (olddecl)) TREE_TYPE (newdecl) @@ -1688,6 +1699,8 @@ duplicate_decls (newdecl, olddecl) are assigned. */ if (DECL_SECTION_NAME (newdecl) == NULL_TREE) DECL_SECTION_NAME (newdecl) = DECL_SECTION_NAME (olddecl); + + pop_obstacks (); } /* If cannot merge, then use the new type and qualifiers, and don't preserve the old rtl. */ |