From: Kresten Krab Thorup Date: Wed, 22 Sep 1993 17:38:20 +0000 (+0000) Subject: (output_constructor): Use the type given by the constructor expression only if available. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1108dc3d1fb30be1b0fbeeab9af3007251d28bc2;p=gcc.git (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 --- diff --git a/gcc/varasm.c b/gcc/varasm.c index 7d16f36a2a3..641c6b7ff97 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);