mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-30 15:35:40 +08:00
dwarf2out.c (simple_type_size_in_bits): Handle a type with no computed size as size zero.
* dwarf2out.c (simple_type_size_in_bits): Handle a type with no computed size as size zero. (field_byte_offset): Likewise. From-SVN: r37578
This commit is contained in:
parent
cfd1c7ea39
commit
3df188844e
@ -1,3 +1,9 @@
|
|||||||
|
2000-11-19 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
|
* dwarf2out.c (simple_type_size_in_bits): Handle a type with
|
||||||
|
no computed size as size zero.
|
||||||
|
(field_byte_offset): Likewise.
|
||||||
|
|
||||||
2000-11-20 Joseph S. Myers <jsm28@cam.ac.uk>
|
2000-11-20 Joseph S. Myers <jsm28@cam.ac.uk>
|
||||||
|
|
||||||
* config.gcc: Fix another typo.
|
* config.gcc: Fix another typo.
|
||||||
|
@ -7790,17 +7790,17 @@ static inline unsigned HOST_WIDE_INT
|
|||||||
simple_type_size_in_bits (type)
|
simple_type_size_in_bits (type)
|
||||||
register tree type;
|
register tree type;
|
||||||
{
|
{
|
||||||
|
tree type_size_tree;
|
||||||
|
|
||||||
if (TREE_CODE (type) == ERROR_MARK)
|
if (TREE_CODE (type) == ERROR_MARK)
|
||||||
return BITS_PER_WORD;
|
return BITS_PER_WORD;
|
||||||
else
|
type_size_tree = TYPE_SIZE (type);
|
||||||
{
|
|
||||||
register tree type_size_tree = TYPE_SIZE (type);
|
|
||||||
|
|
||||||
if (! host_integerp (type_size_tree, 1))
|
if (type_size_tree == NULL_TREE)
|
||||||
return TYPE_ALIGN (type);
|
return 0;
|
||||||
|
if (! host_integerp (type_size_tree, 1))
|
||||||
return tree_low_cst (type_size_tree, 1);
|
return TYPE_ALIGN (type);
|
||||||
}
|
return tree_low_cst (type_size_tree, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Given a pointer to what is assumed to be a FIELD_DECL node, compute and
|
/* Given a pointer to what is assumed to be a FIELD_DECL node, compute and
|
||||||
@ -7835,14 +7835,10 @@ field_byte_offset (decl)
|
|||||||
type = field_type (decl);
|
type = field_type (decl);
|
||||||
field_size_tree = DECL_SIZE (decl);
|
field_size_tree = DECL_SIZE (decl);
|
||||||
|
|
||||||
/* If there was an error, the size could be zero. */
|
/* 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 (errorcount)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
abort ();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* We cannot yet cope with fields whose positions are variable, so
|
/* We cannot yet cope with fields whose positions are variable, so
|
||||||
for now, when we see such things, we simply return 0. Someday, we may
|
for now, when we see such things, we simply return 0. Someday, we may
|
||||||
@ -7852,7 +7848,7 @@ field_byte_offset (decl)
|
|||||||
|
|
||||||
bitpos_int = int_bit_position (decl);
|
bitpos_int = int_bit_position (decl);
|
||||||
|
|
||||||
/* If we don't know the size of the field, pretend it's a full word. */
|
/* If we don't know the size of the field, pretend it's a full word. */
|
||||||
if (host_integerp (field_size_tree, 1))
|
if (host_integerp (field_size_tree, 1))
|
||||||
field_size_in_bits = tree_low_cst (field_size_tree, 1);
|
field_size_in_bits = tree_low_cst (field_size_tree, 1);
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user