+2009-04-17 Eric Botcazou <ebotcazou@adacore.com>
+
+ * dwarf2out.c (field_byte_offset): Use the type size as the field size
+ if the latter is not constant.
+
2009-04-17 David Edelsohn <edelsohn@gnu.org>
* dbxout.c (xcoff_debug_hooks): Add set_name_debug_nothing.
unsigned HOST_WIDE_INT type_size_in_bits;
type = field_type (decl);
+ type_size_in_bits = simple_type_size_in_bits (type);
+ type_align_in_bits = simple_type_align_in_bits (type);
+
field_size_tree = DECL_SIZE (decl);
/* The size could be unspecified if there was an error, or for
a flexible array member. */
- if (! field_size_tree)
+ if (!field_size_tree)
field_size_tree = bitsize_zero_node;
- /* If we don't know the size of the field, pretend it's a full word. */
+ /* If the size of the field is not constant, use the type size. */
if (host_integerp (field_size_tree, 1))
field_size_in_bits = tree_low_cst (field_size_tree, 1);
else
- field_size_in_bits = BITS_PER_WORD;
+ field_size_in_bits = type_size_in_bits;
- type_size_in_bits = simple_type_size_in_bits (type);
- type_align_in_bits = simple_type_align_in_bits (type);
decl_align_in_bits = simple_decl_align_in_bits (decl);
/* The GCC front-end doesn't make any attempt to keep track of the