summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-20 21:40:30 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-20 21:40:30 +0000
commit9c0f0e88ebccc94a3a422268c469e49093c09f4f (patch)
tree0cfb9ab98ee807bf855b7a54fccfd68f71ac76c8
parent9a356f094bfc599903cc39c58cdfffe0452ce4ef (diff)
downloadgcc-9c0f0e88ebccc94a3a422268c469e49093c09f4f.tar.gz
* dwarf.h (FMT_CODE): Adjust argument order; fix mapping to
dwarf_subscr_data_formats bits. * dwarfout.c (simple_type_size_in_bits): Handle a type with no computed size as size zero. (field_byte_offset): Likewise. (subscript_data_attribute): Handle a range with no upper bound. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37592 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/dwarf.h6
-rw-r--r--gcc/dwarfout.c38
3 files changed, 28 insertions, 25 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 37379643aaf..1eda6663b8e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2000-11-20 Richard Henderson <rth@redhat.com>
+
+ * dwarf.h (FMT_CODE): Adjust argument order; fix mapping to
+ dwarf_subscr_data_formats bits.
+ * dwarfout.c (simple_type_size_in_bits): Handle a type with
+ no computed size as size zero.
+ (field_byte_offset): Likewise.
+ (subscript_data_attribute): Handle a range with no upper bound.
+
2000-11-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gansidecl.h (const): Check __STDC__ before undef'ing `const'.
diff --git a/gcc/dwarf.h b/gcc/dwarf.h
index 9d9b96dd997..876bdc0abe5 100644
--- a/gcc/dwarf.h
+++ b/gcc/dwarf.h
@@ -285,10 +285,10 @@ enum dwarf_subscr_data_formats {
/* Derived from above for ease of use. */
-#define FMT_CODE(_FUNDAMENTAL_TYPE_P, _UB_CONST_P, _LB_CONST_P) \
+#define FMT_CODE(_FUNDAMENTAL_TYPE_P, _LB_CONST_P, _UB_CONST_P) \
(((_FUNDAMENTAL_TYPE_P) ? 0 : 4) \
- | ((_UB_CONST_P) ? 0 : 2) \
- | ((_LB_CONST_P) ? 0 : 1))
+ | ((_LB_CONST_P) ? 0 : 2) \
+ | ((_UB_CONST_P) ? 0 : 1))
/* Source language names and codes. */
diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c
index 708c574fa71..e339820e87d 100644
--- a/gcc/dwarfout.c
+++ b/gcc/dwarfout.c
@@ -1886,17 +1886,17 @@ static inline unsigned HOST_WIDE_INT
simple_type_size_in_bits (type)
register tree type;
{
+ tree type_size_tree;
+
if (TREE_CODE (type) == ERROR_MARK)
return BITS_PER_WORD;
- else
- {
- register tree type_size_tree = TYPE_SIZE (type);
+ type_size_tree = TYPE_SIZE (type);
- if (! host_integerp (type_size_tree, 1))
- return TYPE_ALIGN (type);
-
- return tree_low_cst (type_size_tree, 1);
- }
+ if (type_size_tree == NULL_TREE)
+ return 0;
+ if (! host_integerp (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
@@ -1931,15 +1931,11 @@ field_byte_offset (decl)
type = field_type (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 (errorcount)
- return 0;
+ field_size_tree = bitsize_zero_node;
- abort ();
- }
-
/* We cannot yet cope with fields whose positions or sizes are variable,
so for now, when we see such things, we simply return 0. Someday,
we may be able to handle such cases, but it will be damn difficult. */
@@ -2533,28 +2529,26 @@ subscript_data_attribute (type)
register tree upper = TYPE_MAX_VALUE (domain);
/* Handle only fundamental types as index types for now. */
-
if (! type_is_fundamental (domain))
abort ();
/* Output the representation format byte for this dimension. */
-
ASM_OUTPUT_DWARF_FMT_BYTE (asm_out_file,
FMT_CODE (1, TREE_CODE (lower) == INTEGER_CST,
- (upper && TREE_CODE (upper) == INTEGER_CST)));
+ upper && TREE_CODE (upper) == INTEGER_CST));
/* Output the index type for this dimension. */
-
ASM_OUTPUT_DWARF_FUND_TYPE (asm_out_file,
fundamental_type_code (domain));
/* Output the representation for the lower bound. */
-
output_bound_representation (lower, dimension_number, 'l');
/* Output the representation for the upper bound. */
-
- output_bound_representation (upper, dimension_number, 'u');
+ if (upper)
+ output_bound_representation (upper, dimension_number, 'u');
+ else
+ ASM_OUTPUT_DWARF_DATA2 (asm_out_file, 0);
}
else
{