This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
This patch addresses one of the weirdnesses Kenny noted that showed up when reading and writing bit_size_type (68 bit precision) through the DWARF encoding. OK to commit?
2006-10-10 Sandra Loosemore <sandra@codesourcery.com>
* gcc/dwarf2out.c (base_type_die): Add DW_AT_bit_size and DW_AT_bit_offset attributes for integral types with a precision smaller than the bit size of their containing object. * gcc/lto/lto.c (lto_read_base_type_DIE): Do the inverse when constructing integral types.
! byte_size = int_size_in_bytes (type);
! add_AT_unsigned (base_type_result, DW_AT_byte_size, byte_size);
add_AT_unsigned (base_type_result, DW_AT_encoding, encoding);
+ /* Emit information to allow the LTO front end to reconstruct integral
+ types whose precision is less than the bit width of their containing
+ object, e.g., bitsizetype. */
+ if (TREE_CODE (type) == INTEGER_TYPE + && TYPE_PRECISION (type) < byte_size * BITS_PER_UNIT) + { + add_AT_unsigned (base_type_result, DW_AT_bit_size, + TYPE_PRECISION (type)); + add_AT_unsigned (base_type_result, DW_AT_bit_offset, + byte_size * BITS_PER_UNIT - TYPE_PRECISION (type)); + }
-- Mark Mitchell CodeSourcery mark@codesourcery.com (650) 331-3385 x713
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |