From: Richard Kenner Date: Fri, 11 Mar 1994 12:21:22 +0000 (-0500) Subject: (finish_decl): When preserving an initializer, ensure its type is on a X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7d49f92a42266a582f1c2be94b8ac615240c74ce;p=gcc.git (finish_decl): When preserving an initializer, ensure its type is on a good obstack. From-SVN: r6742 --- diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 889a185209f..af0cf1ba256 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -3588,6 +3588,12 @@ finish_decl (decl, init, asmspec_tree) output_constant_def to make its rtl on the permanent obstack. */ TREE_PERMANENT (DECL_INITIAL (decl)) = 1; + + /* The initializer and DECL must have the same (or equivalent + types), but if the initializer is a STRING_CST, its type + might not be on the right obstack, so copy the type + of DECL. */ + TREE_TYPE (DECL_INITIAL (decl)) = type; } else DECL_INITIAL (decl) = error_mark_node;