* Different dynamical array debug info 7.2 vs. 8.0
@ 2018-01-23 16:02 Yao Qi
2018-01-24 21:48 ` Yao Qi
0 siblings, 1 reply; 2+ messages in thread
From: Yao Qi @ 2018-01-23 16:02 UTC (permalink / raw)
To: fortran, gcc; +Cc: gdb
Hi,
I observed that gfortran 7.2 and 8.0 generate different debug info for
dynamical array. Here is a case simplified from gdb test case
gdb.fortran/vla-datatypes.f90
$ cat vla-datatypes.f90
program vla_primitives
integer, allocatable :: intvla(:, :, :)
logical :: l
allocate (intvla (11,22,33))
l = allocated(intvla) ! vlas-allocated
intvla(:,:,:) = 1
intvla(5,5,5) = 42 ! vlas-initialized
end program vla_primitives
In gcc 8.0, the intvla debug info is,
<2><b2>: Abbrev Number: 10 (DW_TAG_variable)
<b3> DW_AT_name : (indirect string, offset: 0xcb): intvla
<b7> DW_AT_decl_file : 1
<b8> DW_AT_decl_line : 2
<b9> DW_AT_type : <0x127>
<bd> DW_AT_location : 3 byte block: 91 e0 7e (DW_OP_fbreg: -160)
<1><127>: Abbrev Number: 14 (DW_TAG_array_type)
<128> DW_AT_ordering : 1 (column major)
<129> DW_AT_data_location: 4 byte block: 97 23 8 6 (DW_OP_push_object_address; DW_OP_plus_uconst: 8; DW_OP_deref)
<12e> DW_AT_allocated : 6 byte block: 97 23 8 6 30 2e (DW_OP_push_object_address; DW_OP_plus_uconst: 8; DW_OP_deref; DW_OP_lit0; DW_OP_ne)
<135> DW_AT_type : <0x7b>
<139> DW_AT_sibling : <0x174>
<2><13d>: Abbrev Number: 15 (DW_TAG_subrange_type)
<13e> DW_AT_lower_bound : 4 byte block: 97 23 28 6 (DW_OP_push_object_address; DW_OP_plus_uconst: 40; DW_OP_deref)
<143> DW_AT_upper_bound : 4 byte block: 97 23 30 6 (DW_OP_push_object_address; DW_OP_plus_uconst: 48; DW_OP_deref)
<148> DW_AT_byte_stride : 6 byte block: 97 23 20 6 34 1e (DW_OP_push_object_address; DW_OP_plus_uconst: 32; DW_OP_deref; DW_OP_lit4; DW_OP_mul)
<2><14f>: Abbrev Number: 15 (DW_TAG_subrange_type)
<150> DW_AT_lower_bound : 4 byte block: 97 23 40 6 (DW_OP_push_object_address; DW_OP_plus_uconst: 64; DW_OP_deref)
<155> DW_AT_upper_bound : 4 byte block: 97 23 48 6 (DW_OP_push_object_address; DW_OP_plus_uconst: 72; DW_OP_deref)
<15a> DW_AT_byte_stride : 6 byte block: 97 23 38 6 34 1e (DW_OP_push_object_address; DW_OP_plus_uconst: 56; DW_OP_deref; DW_OP_lit4; DW_OP_mul)
<2><161>: Abbrev Number: 15 (DW_TAG_subrange_type)
<162> DW_AT_lower_bound : 4 byte block: 97 23 58 6 (DW_OP_push_object_address; DW_OP_plus_uconst: 88; DW_OP_deref)
<167> DW_AT_upper_bound : 4 byte block: 97 23 60 6 (DW_OP_push_object_address; DW_OP_plus_uconst: 96; DW_OP_deref)
<16c> DW_AT_byte_stride : 6 byte block: 97 23 50 6 34 1e (DW_OP_push_object_address; DW_OP_plus_uconst: 80; DW_OP_deref; DW_OP_lit4; DW_OP_mul)
<2><173>: Abbrev Number: 0
In gcc 7.2, it is,
<2><b2>: Abbrev Number: 10 (DW_TAG_variable)
<b3> DW_AT_name : (indirect string, offset: 0x12): intvla
<b7> DW_AT_decl_file : 1
<b8> DW_AT_decl_line : 2
<b9> DW_AT_type : <0x127>
<bd> DW_AT_location : 3 byte block: 91 e0 7e (DW_OP_fbreg: -160)
<1><127>: Abbrev Number: 14 (DW_TAG_array_type)
<128> DW_AT_ordering : 1 (column major)
<129> DW_AT_data_location: 2 byte block: 97 6 (DW_OP_push_object_address; DW_OP_deref)
<12c> DW_AT_allocated : 4 byte block: 97 6 30 2e (DW_OP_push_object_address; DW_OP_deref; DW_OP_lit0; DW_OP_ne)
<131> DW_AT_type : <0x7b>
<135> DW_AT_sibling : <0x170>
<2><139>: Abbrev Number: 15 (DW_TAG_subrange_type)
<13a> DW_AT_lower_bound : 4 byte block: 97 23 20 6 (DW_OP_push_object_address; DW_OP_plus_uconst: 32; DW_OP_deref)
<13f> DW_AT_upper_bound : 4 byte block: 97 23 28 6 (DW_OP_push_object_address; DW_OP_plus_uconst: 40; DW_OP_deref)
<144> DW_AT_byte_stride : 6 byte block: 97 23 18 6 34 1e (DW_OP_push_object_address; DW_OP_plus_uconst: 24; DW_OP_deref; DW_OP_lit4; DW_OP_mul)
<2><14b>: Abbrev Number: 15 (DW_TAG_subrange_type)
<14c> DW_AT_lower_bound : 4 byte block: 97 23 38 6 (DW_OP_push_object_address; DW_OP_plus_uconst: 56; DW_OP_deref)
<151> DW_AT_upper_bound : 4 byte block: 97 23 40 6 (DW_OP_push_object_address; DW_OP_plus_uconst: 64; DW_OP_deref)
<156> DW_AT_byte_stride : 6 byte block: 97 23 30 6 34 1e (DW_OP_push_object_address; DW_OP_plus_uconst: 48; DW_OP_deref; DW_OP_lit4; DW_OP_mul)
<2><15d>: Abbrev Number: 15 (DW_TAG_subrange_type)
<15e> DW_AT_lower_bound : 4 byte block: 97 23 50 6 (DW_OP_push_object_address; DW_OP_plus_uconst: 80; DW_OP_deref)
<163> DW_AT_upper_bound : 4 byte block: 97 23 58 6 (DW_OP_push_object_address; DW_OP_plus_uconst: 88; DW_OP_deref)
<168> DW_AT_byte_stride : 6 byte block: 97 23 48 6 34 1e (DW_OP_push_object_address; DW_OP_plus_uconst: 72; DW_OP_deref; DW_OP_lit4; DW_OP_mul)
<2><16f>: Abbrev Number:
Attributes DW_AT_data_location and DW_AT_allocated are different. There
is an extra "DW_OP_plus_uconst: 8" generated by gcc 8.0. Is it
intended or expected? gfortran 8.0 causes many gdb.fotran vla-related
tests fail, but gfortran 7.2 doesn't. That is why I took a look at the
debug information.
--
Yao (齐尧)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Different dynamical array debug info 7.2 vs. 8.0
2018-01-23 16:02 Different dynamical array debug info 7.2 vs. 8.0 Yao Qi
@ 2018-01-24 21:48 ` Yao Qi
0 siblings, 0 replies; 2+ messages in thread
From: Yao Qi @ 2018-01-24 21:48 UTC (permalink / raw)
To: fortran, gcc, pault; +Cc: GDB
On Tue, Jan 23, 2018 at 4:02 PM, Yao Qi <qiyaoltc@gmail.com> wrote:
>
> Hi,
> I observed that gfortran 7.2 and 8.0 generate different debug info for
> dynamical array.
> Attributes DW_AT_data_location and DW_AT_allocated are different. There
> is an extra "DW_OP_plus_uconst: 8" generated by gcc 8.0. Is it
> intended or expected? gfortran 8.0 causes many gdb.fotran vla-related
> tests fail, but gfortran 7.2 doesn't. That is why I took a look at the
> debug information.
>
I did 'git bisect', and find the following commit causes the change in the
debug information. Paul, do you have any clue on the different debug
information caused by your commit?
commit c0dbf68e8b1cf24bd54de0c3b6ec056436f174ac
Author: pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sun Sep 10 17:02:53 2017 +0000
2017-09-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34640
PR fortran/40737
PR fortran/55763
PR fortran/57019
PR fortran/57116
* expr.c (is_subref_array): Add class pointer array dummies
to the list of expressions that return true.
* trans-array.c: Add SPAN_FIELD and update indices for
subsequent fields.
(gfc_conv_descriptor_span, gfc_conv_descriptor_span_get,
gfc_conv_descriptor_span_set, is_pointer_array,
get_array_span): New functions.
(gfc_get_descriptor_offsets_for_info): New function to preserve
API for access to descriptor fields for trans-types.c.
(gfc_conv_scalarized_array_ref): If the expression is a subref
array, make sure that info->descriptor is a descriptor type.
Otherwise, if info->descriptor is a pointer array, set 'decl'
and fix it if it is a component reference.
(build_array_ref): Simplify handling of class array refs by
passing the vptr to gfc_build_array_ref rather than generating
the pointer arithmetic in this function.
(gfc_conv_array_ref): As in gfc_conv_scalarized_array_ref, set
'decl'.
(gfc_array_allocate): Set the span field if this is a pointer
array. Use the expr3 element size if it is available, so that
the dynamic type element size is used.
(gfc_conv_expr_descriptor): Set the span field for pointer
assignments.
--
Yao (齐尧)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-24 21:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-23 16:02 Different dynamical array debug info 7.2 vs. 8.0 Yao Qi
2018-01-24 21:48 ` Yao Qi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox