+ ce->index = size_int (i);
+ gcc_assert (ce->value);
+ ce->value = digest_init_r (TREE_TYPE (type), ce->value, true, LOOKUP_IMPLICIT);
+
+ if (ce->value != error_mark_node)
+ gcc_assert (same_type_ignoring_top_level_qualifiers_p
+ (TREE_TYPE (type), TREE_TYPE (ce->value)));
+
+ flags |= picflag_from_initializer (ce->value);
+ }
+
+ /* No more initializers. If the array is unbounded, we are done. Otherwise,
+ we must add initializers ourselves. */
+ if (!unbounded)
+ for (; i < len; ++i)
+ {
+ tree next;
+
+ if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (type)))
+ {
+ /* If this type needs constructors run for default-initialization,
+ we can't rely on the back end to do it for us, so build up
+ TARGET_EXPRs. If the type in question is a class, just build
+ one up; if it's an array, recurse. */
+ if (MAYBE_CLASS_TYPE_P (TREE_TYPE (type)))
+ next = build_functional_cast (TREE_TYPE (type), NULL_TREE,
+ tf_warning_or_error);
+ else
+ next = build_constructor (init_list_type_node, NULL);
+ next = digest_init (TREE_TYPE (type), next);
+ }
+ else if (!zero_init_p (TREE_TYPE (type)))
+ next = build_zero_init (TREE_TYPE (type),
+ /*nelts=*/NULL_TREE,
+ /*static_storage_p=*/false);
+ else
+ /* The default zero-initialization is fine for us; don't
+ add anything to the CONSTRUCTOR. */
+ break;
+
+ flags |= picflag_from_initializer (next);
+ CONSTRUCTOR_APPEND_ELT (v, size_int (i), next);
+ }
+
+ CONSTRUCTOR_ELTS (init) = v;
+ return flags;
+}
+
+/* Subroutine of process_init_constructor, which will process an initializer
+ INIT for a class of type TYPE. Returns the flags (PICFLAG_*) which describe
+ the initializers. */
+
+static int
+process_init_constructor_record (tree type, tree init)
+{
+ VEC(constructor_elt,gc) *v = NULL;
+ int flags = 0;
+ tree field;
+ unsigned HOST_WIDE_INT idx = 0;
+
+ gcc_assert (TREE_CODE (type) == RECORD_TYPE);
+ gcc_assert (!CLASSTYPE_VBASECLASSES (type));
+ gcc_assert (!TYPE_BINFO (type)
+ || !BINFO_N_BASE_BINFOS (TYPE_BINFO (type)));
+ gcc_assert (!TYPE_POLYMORPHIC_P (type));
+
+ /* Generally, we will always have an index for each initializer (which is
+ a FIELD_DECL, put by reshape_init), but compound literals don't go trough
+ reshape_init. So we need to handle both cases. */
+ for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ {
+ tree next;
+ tree type;
+
+ if (!DECL_NAME (field) && DECL_C_BIT_FIELD (field))