https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77865
Bug ID: 77865
Summary: Regression: wrong debug information for gfortran
pointers to structures
Product: gcc
Version: 6.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: nikolay.piskun at roguewave dot com
Target Milestone: ---
Created attachment 39757
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39757&action=edit
Test program
Here is example of code that generate wrong debug information
type small_stride
character*40 long_string
integer small_pad
end type small_stride
character*40, pointer, dimension(:):: c40pt
type(small_stride), dimension (20), target :: unpleasant
... Initialize unpleasant
c40pt => unpleasant%long_string
gfortran 5.2 will produce following arrays bounds for c40pt:
<2><307>: Abbrev Number: 26 (DW_TAG_subrange_type)
<308> DW_AT_lower_bound : 4 byte block: 97 23 20 6
(DW_OP_push_object_address; DW_OP_plus_uconst: 32; DW_OP_deref)
<30d> DW_AT_upper_bound : 4 byte block: 97 23 28 6
(DW_OP_push_object_address; DW_OP_plus_uconst: 40; DW_OP_deref)
<312> DW_AT_byte_stride : 9 byte block: 97 23 18 6 91 b0 7f 6 1e
(DW_OP_push_object_address; DW_OP_plus_uconst: 24; DW_OP_deref; DW_OP_fbreg:
-80; DW_OP_deref; DW_OP_mul)
whereas gcc 6.2.0 lacks stride information.
<2><307>: Abbrev Number: 26 (DW_TAG_subrange_type)
<308> DW_AT_lower_bound : 4 byte block: 97 23 20 6
(DW_OP_push_object_address; DW_OP_plus_uconst: 32; DW_OP_deref)
<30d> DW_AT_upper_bound : 4 byte block: 97 23 28 6
(DW_OP_push_object_address; DW_OP_plus_uconst: 40; DW_OP_deref)