On Mon, Nov 11, 2013 at 6:06 PM, Eric Botcazou <ebotca...@adacore.com> wrote: >> Due to the different interfaces of int_size_in_bytes and >> simple_type_size_in_bits (and 'size' in add_byte_size_attribute being >> unsigned and not [unsigned] HWI) it would be cleaner to >> add an early return after the call to int_size_in_bytes if its >> return value is -1 (and make sure the return value doesn't >> overflow an unsigned int - likewise for simple_type_size_in_bits, >> not sure why that case doesn't use int_size_in_bytes as well ...)? > > Both calls are present in the first version of the function, but I agree that > the discrepancy looks strange. > > Revised version attached, tested {GCC,GDB} on x86_64-suse-linux.
Ok. Thanks, Richard. > 2013-11-11 Eric Botcazou <ebotca...@adacore.com> > > PR ada/35998 > * dwarf2out.c (add_byte_size_attribute): Use int_size_in_bytes also > for fields. Do not add the attribute if the size is negative. > > > -- > Eric Botcazou