Hi!
Given e.g.:
program test
integer (kind=1), parameter :: i1 = 127_1
integer (kind=2), parameter :: i2 = 28_2
integer (kind=4), parameter :: i4 = 36_4
integer (kind=8), parameter :: i8 = 44_8
write (*,*) i1, i2, i4, i8
end
current gfortran emits the debug info for i1 as:
.uleb128 0x2 # (DIE (0x2d) DW_TAG_const_type)
.long 0x32 # DW_AT_type
.uleb128 0x3 # (DIE (0x32) DW_TAG_base_type)
.byte 0x1 # DW_AT_byte_size
.byte 0x6 # DW_AT_encoding
.long .LASF0 # DW_AT_name: "integer(kind=1)"
...
.ascii "i1\0" # DW_AT_name
.byte 0x1 # DW_AT_decl_file (foo.f90)
.byte 0x2 # DW_AT_decl_line
.long 0x2d # DW_AT_type
.byte 0x7f # DW_AT_const_value
which has wrong DW_AT_encoding value for the type - DW_ATE_signed_char
instead of DW_ATE_signed. This may be used by debuggers to decide
how to print the values.
The following patch avoids using the signed_char_type_node type (which has
TYPE_STRING_FLAG set in tree.c) for Fortran integer(kind=1) type.
Bootstrapped/regtested on x86_64-linux, ok for trunk?