public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/105785] New: DIEs for local types are emitted at wrong scope in DWARF debug info
@ 2022-05-31  7:46 nils-christian.kempke at intel dot com
  2022-06-01 11:54 ` [Bug fortran/105785] " rguenth at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: nils-christian.kempke at intel dot com @ 2022-05-31  7:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105785
           Summary: DIEs for local types are emitted at wrong scope in
                    DWARF debug info
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: wrong-debug
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nils-christian.kempke at intel dot com
  Target Milestone: ---

This was tested with
-------------------------------------------------------------------
>> gfortran --version
GNU Fortran (GCC) 13.0.0 20220510 (experimental)
...
-------------------------------------------------------------------

Compiling a Fortran program with a locally defined type as in
-------------------------------------------------------------------
>> cat f.f90
program prog
  type :: test
     integer :: int
  end type test

  type (test) :: test_var
  test_var%int = 33
  print *, test_var
end program prog
>> gfortran -O0 -g ./f.f90
>>
-------------------------------------------------------------------
and checking its debug info we see
-------------------------------------------------------------------
>> objdump --dwarf=info ./a.out
...
 <0><c>: Abbrev Number: 3 (DW_TAG_compile_unit)
    ...
 <1><2f>: Abbrev Number: 4 (DW_TAG_structure_type)
    <30>   DW_AT_name        : (indirect string, offset: 0x117): test
    ...
    <38>   DW_AT_sibling     : <0x4a>
 <2><3c>: Abbrev Number: 5 (DW_TAG_member)
    <3d>   DW_AT_name        : int
    ...
 <2><49>: Abbrev Number: 0
 ...
 <1><9f>: Abbrev Number: 9 (DW_TAG_subprogram)
    <a0>   DW_AT_name        : (indirect string, offset: 0x20): prog
    ...
 <2><ba>: Abbrev Number: 10 (DW_TAG_variable)
    <bb>   DW_AT_name        : (indirect string, offset: 0x17): test_var
    ...
 <2><c9>: Abbrev Number: 0
 <1><ca>: Abbrev Number: 0
-------------------------------------------------------------------
The type declared inside the Fortran program prog is emitted as a child of the
whole compile unit even though its visibility is limited to the scope of prog.
It should instead be emitted as a child of the DW_TAG_subprogram prog (as to
limit its visibility appropriately).

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug fortran/105785] DIEs for local types are emitted at wrong scope in DWARF debug info
  2022-05-31  7:46 [Bug fortran/105785] New: DIEs for local types are emitted at wrong scope in DWARF debug info nils-christian.kempke at intel dot com
@ 2022-06-01 11:54 ` rguenth at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-06-01 11:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
probably missing TYPE_CONTEXT here

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-01 11:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-31  7:46 [Bug fortran/105785] New: DIEs for local types are emitted at wrong scope in DWARF debug info nils-christian.kempke at intel dot com
2022-06-01 11:54 ` [Bug fortran/105785] " rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).