OSDN Git Service

(output_constructor): Use the type given
authorkrab <krab@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Sep 1993 17:38:20 +0000 (17:38 +0000)
committerkrab <krab@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Sep 1993 17:38:20 +0000 (17:38 +0000)
by the constructor expression only if available.  Otherwise
use the type of the declared type.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@5390 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/varasm.c

index 7d16f36..641c6b7 100644 (file)
@@ -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);