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

            Bug ID: 88644
           Summary: Unexpected pub type info eliminated after r 246973
                    (causes pubtypes-*.c to regress).
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iains at gcc dot gnu.org
  Target Milestone: ---

r246973 addresses  PR debug/80263 with :
        * dwarf2out.c (modified_type_die): Try harder not to emit internal
        sizetype type into debug info.

This appears to do the expected thing for debug_info on Darwin (i.e. same as
Linux):

         .byte   0x7     # DW_AT_encoding
-       .ascii "sizetype\0"     # DW_AT_name
-       .byte   0x2     # uleb128 0x2; (DIE (0x18c) DW_TAG_base_type)
+       .ascii "long unsigned int\0"    # DW_AT_name
+       .byte   0x2     # uleb128 0x2; (DIE (0x1a4) DW_TAG_base_type)

and..
        .byte   0x8     # DW_AT_byte_size
-       .byte   0x7     # DW_AT_encoding
-       .ascii "long unsigned int\0"    # DW_AT_name
-       .byte   0x5     # uleb128 0x5; (DIE (0x1ae) DW_TAG_pointer_type)
-       .byte   0x8     # DW_AT_byte_size
-       .byte   0x4     # uleb128 0x4; (DIE (0x1b0) DW_TAG_typedef)
+       .byte   0x4     # uleb128 0x4; (DIE (0x1b3) DW_TAG_typedef)

but it has an unexpected effect on pubtypes

        .ascii "sizetype\0"     # external name
-       .long   0x18c   # DIE offset
+       .long   0x1a4   # DIE offset
+       .byte   0x90    # GDB-index flags
        .ascii "char\0" # external name
-       .long   0x199   # DIE offset
-       .ascii "long unsigned int\0"    # external name
-       .long   0x1b0   # DIE offset
+       .long   0x1b3   # DIE offset
+       .byte   0x90    # GDB-index flags

So .. here the sizetype is still emitted (not intended) and the underlying type
is not.

Linux does the expected thing.

AFAICT, the only difference appears to be that "long unsigned int" appears
*after* "sizetype" on Darwin but *before* it on Linux.

Reply via email to