+2009-02-03 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/35433
+ * c-typeck.c (composite_type): Set TYPE_SIZE and TYPE_SIZE_UNIT
+ for composite type involving a zero-length array type.
+
2009-02-03 Jakub Jelinek <jakub@redhat.com>
PR target/35318
tree d2 = TYPE_DOMAIN (t2);
bool d1_variable, d2_variable;
bool d1_zero, d2_zero;
+ bool t1_complete, t2_complete;
/* We should not have any type quals on arrays at all. */
gcc_assert (!TYPE_QUALS (t1) && !TYPE_QUALS (t2));
+ t1_complete = COMPLETE_TYPE_P (t1);
+ t2_complete = COMPLETE_TYPE_P (t2);
+
d1_zero = d1 == 0 || !TYPE_MAX_VALUE (d1);
d2_zero = d2 == 0 || !TYPE_MAX_VALUE (d2);
|| !d1_variable))
? t1
: t2));
+ /* Ensure a composite type involving a zero-length array type
+ is a zero-length type not an incomplete type. */
+ if (d1_zero && d2_zero
+ && (t1_complete || t2_complete)
+ && !COMPLETE_TYPE_P (t1))
+ {
+ TYPE_SIZE (t1) = bitsize_zero_node;
+ TYPE_SIZE_UNIT (t1) = size_zero_node;
+ }
t1 = c_build_qualified_type (t1, quals);
return build_type_attribute_variant (t1, attributes);
}