From 1108dc3d1fb30be1b0fbeeab9af3007251d28bc2 Mon Sep 17 00:00:00 2001 From: Kresten Krab Thorup Date: Wed, 22 Sep 1993 17:38:20 +0000 Subject: [PATCH] (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 --- gcc/varasm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- 2.30.2