From: Eric Botcazou Date: Fri, 17 Apr 2009 20:42:16 +0000 (+0000) Subject: dwarf2out.c (field_byte_offset): Use the type size as the field size if the latter... X-Git-Tag: releases/gcc-4.5.0~6452 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9eacf7a62a6c26d070718471112637a4400f9859;p=thirdparty%2Fgcc.git dwarf2out.c (field_byte_offset): Use the type size as the field size if the latter is not constant. * dwarf2out.c (field_byte_offset): Use the type size as the field size if the latter is not constant. From-SVN: r146291 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a9cd06f0d4e3..7134327f1294 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-04-17 Eric Botcazou + + * dwarf2out.c (field_byte_offset): Use the type size as the field size + if the latter is not constant. + 2009-04-17 David Edelsohn * dbxout.c (xcoff_debug_hooks): Add set_name_debug_nothing. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 81a5062fc204..d4799b163b53 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -10900,21 +10900,22 @@ field_byte_offset (const_tree decl) 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