projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3628133
)
(finish_decl): When preserving an initializer, ensure its type is on a
author
Richard Kenner
<kenner@gcc.gnu.org>
Fri, 11 Mar 1994 12:21:22 +0000
(07:21 -0500)
committer
Richard Kenner
<kenner@gcc.gnu.org>
Fri, 11 Mar 1994 12:21:22 +0000
(07:21 -0500)
good obstack.
From-SVN: r6742
gcc/c-decl.c
patch
|
blob
|
history
diff --git
a/gcc/c-decl.c
b/gcc/c-decl.c
index 889a185209fe97ec3807a827ee5f36fa3e47b097..af0cf1ba2569f304ca61f9ed45da91d2c773455f 100644
(file)
--- 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;