public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "abdul.b.ijaz at intel dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/101826] New: GFORTRAN: Debug info missing DW_TAG_string_type for array of variable length string
Date: Mon, 09 Aug 2021 09:27:43 +0000	[thread overview]
Message-ID: <bug-101826-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 101826
           Summary: GFORTRAN: Debug info missing DW_TAG_string_type for
                    array of variable length string
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: abdul.b.ijaz at intel dot com
  Target Milestone: ---

Using GFortran 11.1.0 or older versions it is seen that dwarf debug info does
not contain DW_TAG_string_type for array of variable length strings like shown
in reproducer below and instead it contains DW_TAG_structure_type. As per dwarf
spec there should have been DW_TAG_string_type for string type object.

Reproducer program:

subroutine str_arr (arr1)
  character (len=*):: arr1(:)

  print *, arr1
end subroutine str_arr

program main
interface
  subroutine str_arr (arr1)
    character (len=*):: arr1 (:)
  end subroutine str_arr
end interface
  character (len=10) :: arr (5)

  arr = 'fortranarr'

  call str_arr (arr)

end program main


Dwarf info:

 <1><de>: Abbrev Number: 14 (DW_TAG_subprogram)
    <df>   DW_AT_external    : 1
    <df>   DW_AT_name        : (indirect string, offset: 0x12): str_arr
    <e3>   DW_AT_decl_file   : 1
    <e4>   DW_AT_decl_line   : 1
    <e5>   DW_AT_decl_column : 18
    <e6>   DW_AT_linkage_name: (indirect string, offset: 0x4b): str_arr_
    <ea>   DW_AT_low_pc      : 0x7d5
    <f2>   DW_AT_high_pc     : 0x19f
    <fa>   DW_AT_frame_base  : 1 byte block: 9c         (DW_OP_call_frame_cfa)
    <fc>   DW_AT_GNU_all_tail_call_sites: 1
    <fc>   DW_AT_sibling     : <0x12c>
 <2><100>: Abbrev Number: 15 (DW_TAG_formal_parameter)
    <101>   DW_AT_name        : (indirect string, offset: 0x1): arr1
    <105>   DW_AT_type        : <0x12c>
    <109>   DW_AT_artificial  : 1
    <109>   DW_AT_location    : 4 byte block: 91 f8 7a 6        (DW_OP_fbreg:
-648; DW_OP_deref)
 <2><10e>: Abbrev Number: 15 (DW_TAG_formal_parameter)
    <10f>   DW_AT_name        : (indirect string, offset: 0x0): _arr1
    <113>   DW_AT_type        : <0x35>
    <117>   DW_AT_artificial  : 1
    <117>   DW_AT_location    : 3 byte block: 91 f0 7a  (DW_OP_fbreg: -656)
 <2><11b>: Abbrev Number: 16 (DW_TAG_variable)
    <11c>   DW_AT_type        : <0x2e>
    <120>   DW_AT_artificial  : 1
    <120>   DW_AT_location    : 2 byte block: 91 50     (DW_OP_fbreg: -48)
 <2><123>: Abbrev Number: 16 (DW_TAG_variable)
    <124>   DW_AT_type        : <0x14d>
    <128>   DW_AT_artificial  : 1
    <128>   DW_AT_location    : 2 byte block: 91 58     (DW_OP_fbreg: -40)
 <2><12b>: Abbrev Number: 0
 <1><12c>: Abbrev Number: 17 (DW_TAG_structure_type)
    <12d>   DW_AT_declaration : 1

             reply	other threads:[~2021-08-09  9:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-09  9:27 abdul.b.ijaz at intel dot com [this message]
2021-08-09 13:00 ` [Bug fortran/101826] " rguenth at gcc dot gnu.org
2021-08-09 13:20 ` abdul.b.ijaz at intel dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-101826-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).