(output_init_element): Constructor is not simple if a bitfield is
authorRichard Kenner <kenner@gcc.gnu.org>
Wed, 26 Apr 1995 12:35:12 +0000 (08:35 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Wed, 26 Apr 1995 12:35:12 +0000 (08:35 -0400)
being assigned a non-integer.

From-SVN: r9472

gcc/c-typeck.c

index fd0eae04cfaf400d1a767d4f7abb16f8808abe0d..1873613a9548ec9f05a1d7c16bb8d4f93935097f 100644 (file)
@@ -5707,7 +5707,10 @@ output_init_element (value, type, field, pending)
     constructor_erroneous = 1;
   else if (!TREE_CONSTANT (value))
     constructor_constant = 0;
-  else if (initializer_constant_valid_p (value, TREE_TYPE (value)) == 0)
+  else if (initializer_constant_valid_p (value, TREE_TYPE (value)) == 0
+          || ((TREE_CODE (constructor_type) == RECORD_TYPE
+               || TREE_CODE (constructor_type) == UNION_TYPE)
+              && DECL_BIT_FIELD (field) && TREE_CODE (value) != INTEGER_CST))
     constructor_simple = 0;
 
   if (require_constant_value && ! TREE_CONSTANT (value))