aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKresten Krab Thorup <krab@gcc.gnu.org>1993-09-22 17:38:20 +0000
committerKresten Krab Thorup <krab@gcc.gnu.org>1993-09-22 17:38:20 +0000
commit1108dc3d1fb30be1b0fbeeab9af3007251d28bc2 (patch)
treedd94d930da328ff8c823ac0da85f5bb251345f58
parent538d56bb75ad00b1841398e10e6563035bfde442 (diff)
downloadgcc-1108dc3d1fb30be1b0fbeeab9af3007251d28bc2.zip
gcc-1108dc3d1fb30be1b0fbeeab9af3007251d28bc2.tar.gz
gcc-1108dc3d1fb30be1b0fbeeab9af3007251d28bc2.tar.bz2
(output_constructor): Use the type given by the constructor expression only if available.
(output_constructor): Use the type given by the constructor expression only if available. Otherwise use the type of the declared type. From-SVN: r5390
-rw-r--r--gcc/varasm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 7d16f36..641c6b7 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -3396,7 +3396,11 @@ output_constructor (exp, size)
if (TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE
|| TREE_CODE (TREE_TYPE (exp)) == UNION_TYPE)
- field = TREE_PURPOSE (link);
+ {
+ /* if available, use the type given by link */
+ if (TREE_PURPOSE (link) != 0)
+ field = TREE_PURPOSE (link);
+ }
if (TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE)
index = TREE_PURPOSE (link);