Hi Jakub,

The following patch uses a variant of the character(kind=4) type
for unsigned(kind=4) and a distinct type based on character(kind=1)
type for unsigned(kind=1).  The reason for the latter is that
unsigned_char_type_node has TYPE_STRING_FLAG set on it, so it has
DW_AT_encoding DW_ATE_unsigned_char rather than DW_ATE_unsigned and
so the debugger then likes to print it as characters rather than numbers.
That is IMHO in Fortran desirable for character(kind=1) but not for
unsigned(kind=1).  I've made sure TYPE_CANONICAL of the unsigned(kind=1)
type is still character(kind=1), so they are considered compatible by
the middle-end also e.g. for aliasing etc.

Ah, that's how to do it.  I wasn't really comfortable re-using
CHARACTER, but I had found no better way.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk
and later on for 15.2?

Yes.  And thanks for the patch!

Best regards

        Thomas

Reply via email to