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]

Bug in Dwarf format for fixed point data types?


Hello sir,

I have implemented fixed-point support for a private target in
gcc-4.1.1 based on the fixed point patches given on the gcc mailing
list for gcc 4.3.

For a sample test case, in the dwarf info generated, DW_AT_encoding
tag set to 13 or 14 depending if they are unsigned or signed fxp data
types.

As per the Dwarf3 manual, DW_AT_encoding tag should be set to 13 for
signed types and 14 for unsigned types. But as of now these
information is getting reversed because of the code given below.

Bug Code:
File                 : dwarf2out.c
Function Name: static dw_die_ref base_type_die (tree type)
Line no           : 8435

case FIXED_POINT_TYPE:
      if (TYPE_UNSIGNED (type))
	encoding = DW_ATE_signed_fixed;
      else
	encoding = DW_ATE_unsigned_fixed;
      break;

Another issue:
After making the modification to the above code, the DW_AT_encoding is
set properly. But we get "(unknown type)" instead of getting
signed/unsigned. Is the behavior same in 4.3 or is it that the
signedness information is dumped only for base data types?

<1><a0>: Abbrev Number: 4 (DW_TAG_base_type)
    DW_AT_name        : short __accum
    DW_AT_byte_size   : 2
    DW_AT_encoding    : 13     (unknown type)
<1><b1>: Abbrev Number: 4 (DW_TAG_base_type)
    DW_AT_name        : unsigned short __accum
    DW_AT_byte_size   : 2
    DW_AT_encoding    : 14     (unknown type)
<1><cb>: Abbrev Number: 4 (DW_TAG_base_type)
    DW_AT_name        : int
    DW_AT_byte_size   : 4
    DW_AT_encoding    : 5      (signed)

Regards,
Shafi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]