https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121411

--- Comment #5 from David Faust <david.faust at oracle dot com> ---
Yeah, looks like there are multiple inconsistencies with uint32/unsigned int
versus unsigned HOST_WIDE_INT when fetching values from the DWARF DIEs.
The issues with arrays is one, bit_size in gen_ctf_sou_type is another.
ctf_die_bitsize should also be returning unsigned HWI.

It seems to me that an underlying problem and likely source of mistakes is that
add_AT_unsigned accepts and stores uHWI values, but get_AT_unsigned returns
unsigned (int) not uHWI.  This asymmetry could be causing silent truncation
anywhere; HWI is supposed to always be 64-bits.  There are uses in dwarf2out I
am suspicious of now as well, DW_AT_byte_size is stored as uHWI and elsewhere
read as unsigned int...

Reply via email to