From: Bernhard Heckel <bernhard.heckel@intel.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: brobecker@adacore.com, gdb-patches@sourceware.org
Subject: Re: [PATCH V4 5/6] Resolve dynamic target types of pointers.
Date: Mon, 17 Oct 2016 11:25:00 -0000 [thread overview]
Message-ID: <5804B509.7050103@intel.com> (raw)
In-Reply-To: <86bmyj8dwf.fsf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1536 bytes --]
On 17/10/2016 12:32, Yao Qi wrote:
> Bernhard Heckel <bernhard.heckel@intel.com> writes:
>
>>>> +set test "print intap, not associated"
>>>> +gdb_test_multiple "print intap" $test {
>>>> + -re " = \\(PTR TO -> \\( $int \\(:,:\\)\\)\\) <not
>>>> associated>\r\n$gdb_prompt $" {
>>>> + pass $test
>>>> + }
>>>> + -re " = <not associated>\r\n$gdb_prompt $" {
>>>> + pass $test
>>>> + }
>>>> +}
>>> Why do we need to different regex here? Need to handle the differences
>>> of different compilers? IMO, the former looks reasonable to me.
>> A pointer to an array (especially to Variable Length Array, VLA) is
>> described in Gfortran's compiled debug info
>> like normal array types + associated property of an pointer.
> Could you show the debug information gfortran and ifort generates
> respectively?
see attachment
>
>> Not sure if this is a bug in Gfortran or not? I was also thinking to
>> make the
>> output equal, and check if an array has pointer attributes but ..... I
>> don't really like this approach. This would
>> cause a lot of "if .. else" construct in the code for example:
>> De-reference this pointer, Address operator, ...
> If gfortran people confirm it is a bug, we can xfail the test.
>
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
[-- Attachment #2: gcc_dwarf.txt --]
[-- Type: text/plain, Size: 6032 bytes --]
Contents of the .debug_info section:
Compilation Unit @ offset 0x0:
Length: 0x143 (32-bit)
Version: 4
Abbrev Offset: 0x0
Pointer Size: 8
<0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
<c> DW_AT_producer : (indirect string, offset: 0xa5): GNU Fortran 4.8.3 20140911 (Red Hat 4.8.3-9) -mtune=generic -march=x86-64 -g -O0 -fintrinsic-modules-path /usr/lib/gcc/x86_64-redhat-linux/4.8.3/finclude
<10> DW_AT_language : 14 (Fortran 95)
<11> DW_AT_identifier_case: 2 (down_case)
<12> DW_AT_name : (indirect string, offset: 0x17): pointers.f90
<16> DW_AT_comp_dir : (indirect string, offset: 0x44): .../gdb/testsuite/gdb.fortran
<1a> DW_AT_low_pc : 0x400830
<22> DW_AT_high_pc : 0x1de
<2a> DW_AT_stmt_list : 0x0
<1><2e>: Abbrev Number: 2 (DW_TAG_base_type)
<2f> DW_AT_byte_size : 8
<30> DW_AT_encoding : 5 (signed)
<31> DW_AT_name : (indirect string, offset: 0x2b): integer(kind=8)
<1><35>: Abbrev Number: 3 (DW_TAG_subprogram)
<36> DW_AT_name : (indirect string, offset: 0x3b): pointers
<3a> DW_AT_decl_file : 1
<3b> DW_AT_decl_line : 16
<3c> DW_AT_low_pc : 0x400830
<44> DW_AT_high_pc : 0x1a3
<4c> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa)
<4e> DW_AT_GNU_all_tail_call_sites: 1
<4e> DW_AT_main_subprogram: 1
<4e> DW_AT_calling_convention: 2 (program)
<4f> DW_AT_sibling : <0xa6>
<2><53>: Abbrev Number: 4 (DW_TAG_variable)
<54> DW_AT_name : (indirect string, offset: 0x24): intvla
<58> DW_AT_decl_file : 1
<59> DW_AT_decl_line : 18
<5a> DW_AT_type : <0xa6>
<5e> DW_AT_location : 2 byte block: 91 40 (DW_OP_fbreg: -64)
<2><61>: Abbrev Number: 4 (DW_TAG_variable)
<62> DW_AT_name : (indirect string, offset: 0x83): intvlap
<66> DW_AT_decl_file : 1
<67> DW_AT_decl_line : 19
<68> DW_AT_type : <0xd1>
<6c> DW_AT_location : 3 byte block: 91 90 7f (DW_OP_fbreg: -112)
<2><70>: Abbrev Number: 5 (DW_TAG_lexical_block)
<71> DW_AT_low_pc : 0x400848
<79> DW_AT_high_pc : 0x16c
<3><81>: Abbrev Number: 5 (DW_TAG_lexical_block)
<82> DW_AT_low_pc : 0x40092a
<8a> DW_AT_high_pc : 0x26
<4><92>: Abbrev Number: 6 (DW_TAG_lexical_block)
<93> DW_AT_low_pc : 0x40093a
<9b> DW_AT_high_pc : 0x16
<4><a3>: Abbrev Number: 0
<3><a4>: Abbrev Number: 0
<2><a5>: Abbrev Number: 0
<1><a6>: Abbrev Number: 7 (DW_TAG_array_type)
<a7> DW_AT_data_location: 2 byte block: 97 6 (DW_OP_push_object_address; DW_OP_deref)
<aa> DW_AT_allocated : 4 byte block: 97 6 30 2e (DW_OP_push_object_address; DW_OP_deref; DW_OP_lit0; DW_OP_ne)
<af> DW_AT_type : <0xca>
<b3> DW_AT_sibling : <0xca>
<2><b7>: Abbrev Number: 8 (DW_TAG_subrange_type)
<b8> DW_AT_lower_bound : 4 byte block: 97 23 20 6 (DW_OP_push_object_address; DW_OP_plus_uconst: 32; DW_OP_deref)
<bd> DW_AT_upper_bound : 4 byte block: 97 23 28 6 (DW_OP_push_object_address; DW_OP_plus_uconst: 40; DW_OP_deref)
<c2> 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><c9>: Abbrev Number: 0
<1><ca>: Abbrev Number: 2 (DW_TAG_base_type)
<cb> DW_AT_byte_size : 4
<cc> DW_AT_encoding : 5 (signed)
<cd> DW_AT_name : (indirect string, offset: 0x8b): integer(kind=4)
<1><d1>: Abbrev Number: 9 (DW_TAG_array_type)
<d2> DW_AT_data_location: 2 byte block: 97 6 (DW_OP_push_object_address; DW_OP_deref)
<d5> DW_AT_associated : 4 byte block: 97 6 30 2e (DW_OP_push_object_address; DW_OP_deref; DW_OP_lit0; DW_OP_ne)
<da> DW_AT_type : <0xca>
<de> DW_AT_sibling : <0xf5>
<2><e2>: Abbrev Number: 8 (DW_TAG_subrange_type)
<e3> DW_AT_lower_bound : 4 byte block: 97 23 20 6 (DW_OP_push_object_address; DW_OP_plus_uconst: 32; DW_OP_deref)
<e8> DW_AT_upper_bound : 4 byte block: 97 23 28 6 (DW_OP_push_object_address; DW_OP_plus_uconst: 40; DW_OP_deref)
<ed> 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><f4>: Abbrev Number: 0
<1><f5>: Abbrev Number: 10 (DW_TAG_subprogram)
<f6> DW_AT_external : 1
<f6> DW_AT_name : (indirect string, offset: 0x9b): main
<fa> DW_AT_decl_file : 1
<fb> DW_AT_decl_line : 32
<fc> DW_AT_type : <0xca>
<100> DW_AT_low_pc : 0x4009d3
<108> DW_AT_high_pc : 0x3b
<110> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa)
<112> DW_AT_GNU_all_tail_call_sites: 1
<112> DW_AT_sibling : <0x134>
<2><116>: Abbrev Number: 11 (DW_TAG_formal_parameter)
<117> DW_AT_name : (indirect string, offset: 0xa0): argc
<11b> DW_AT_decl_file : 1
<11c> DW_AT_decl_line : 32
<11d> DW_AT_type : <0x134>
<121> DW_AT_location : 2 byte block: 91 6c (DW_OP_fbreg: -20)
<2><124>: Abbrev Number: 11 (DW_TAG_formal_parameter)
<125> DW_AT_name : (indirect string, offset: 0x12): argv
<129> DW_AT_decl_file : 1
<12a> DW_AT_decl_line : 32
<12b> DW_AT_type : <0x139>
<12f> DW_AT_location : 3 byte block: 91 60 6 (DW_OP_fbreg: -32; DW_OP_deref)
<2><133>: Abbrev Number: 0
<1><134>: Abbrev Number: 12 (DW_TAG_const_type)
<135> DW_AT_type : <0xca>
<1><139>: Abbrev Number: 13 (DW_TAG_pointer_type)
<13a> DW_AT_byte_size : 8
<13b> DW_AT_type : <0x13f>
<1><13f>: Abbrev Number: 2 (DW_TAG_base_type)
<140> DW_AT_byte_size : 1
<141> DW_AT_encoding : 8 (unsigned char)
<142> DW_AT_name : (indirect string, offset: 0x0): character(kind=1)
<1><146>: Abbrev Number: 0
[-- Attachment #3: icc_dwarf.txt --]
[-- Type: text/plain, Size: 4178 bytes --]
Contents of the .debug_info section:
Compilation Unit @ offset 0x0:
Length: 0xdf (32-bit)
Version: 4
Abbrev Offset: 0x0
Pointer Size: 8
<0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
<c> DW_AT_comp_dir : (indirect string, offset: 0x0): .../gdb/testsuite/gdb.fortran
<10> DW_AT_name : (indirect string, offset: 0x51): pointers.f90
<14> DW_AT_producer : (indirect string, offset: 0x5e): Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.0
<18> Unknown AT value: 3b01: (indirect string, offset: 0xd0): -g -O0
<1c> DW_AT_language : 14 (Fortran 95)
<1d> DW_AT_use_UTF8 : 1
<1e> DW_AT_low_pc : 0x402ab0
<26> DW_AT_high_pc : 0x27d
<2e> DW_AT_main_subprogram: 1
<2f> DW_AT_stmt_list : 0x0
<1><33>: Abbrev Number: 2 (DW_TAG_subprogram)
<34> DW_AT_decl_line : 16
<35> DW_AT_decl_file : 1
<36> DW_AT_name : (indirect string, offset: 0xd7): pointers
<3a> DW_AT_calling_convention: 2 (program)
<3b> DW_AT_low_pc : 0x402ab0
<43> DW_AT_high_pc : 0x27d
<4b> DW_AT_main_subprogram: 1
<4c> DW_AT_external : 1
<2><4d>: Abbrev Number: 3 (DW_TAG_variable)
<4e> DW_AT_decl_line : 19
<4f> DW_AT_decl_file : 1
<50> DW_AT_name : (indirect string, offset: 0xe0): intvlap
<54> DW_AT_type : <0x78>
<58> DW_AT_location : 9 byte block: 3 0 f1 6a 0 0 0 0 0 (DW_OP_addr: 6af100)
<2><62>: Abbrev Number: 3 (DW_TAG_variable)
<63> DW_AT_decl_line : 18
<64> DW_AT_decl_file : 1
<65> DW_AT_name : (indirect string, offset: 0xf3): intvla
<69> DW_AT_type : <0xb0>
<6d> DW_AT_location : 9 byte block: 3 a0 c3 6a 0 0 0 0 0 (DW_OP_addr: 6ac3a0)
<2><77>: Abbrev Number: 0
<1><78>: Abbrev Number: 4 (DW_TAG_pointer_type)
<79> DW_AT_type : <0x83>
<7d> DW_AT_associated : 5 byte block: 97 6 10 0 2e (DW_OP_push_object_address; DW_OP_deref; DW_OP_constu: 0; DW_OP_ne)
<1><83>: Abbrev Number: 5 (DW_TAG_array_type)
<84> DW_AT_ordering : 1 (column major)
<85> DW_AT_type : <0xa9>
<89> DW_AT_data_location: 2 byte block: 97 6 (DW_OP_push_object_address; DW_OP_deref)
<2><8c>: Abbrev Number: 6 (DW_TAG_subrange_type)
<8d> DW_AT_byte_stride : 5 byte block: 97 10 38 22 6 (DW_OP_push_object_address; DW_OP_constu: 56; DW_OP_plus; DW_OP_deref)
<93> DW_AT_upper_bound : 14 byte block: 97 10 40 22 6 97 10 30 22 6 22 10 1 1c (DW_OP_push_object_address; DW_OP_constu: 64; DW_OP_plus; DW_OP_deref; DW_OP_push_object_address; DW_OP_constu: 48; DW_OP_plus; DW_OP_deref; DW_OP_plus; DW_OP_constu: 1; DW_OP_minus)
<a2> DW_AT_lower_bound : 5 byte block: 97 10 40 22 6 (DW_OP_push_object_address; DW_OP_constu: 64; DW_OP_plus; DW_OP_deref)
<2><a8>: Abbrev Number: 0
<1><a9>: Abbrev Number: 7 (DW_TAG_base_type)
<aa> DW_AT_byte_size : 4
<ab> DW_AT_encoding : 5 (signed)
<ac> DW_AT_name : (indirect string, offset: 0xe8): INTEGER(4)
<1><b0>: Abbrev Number: 8 (DW_TAG_array_type)
<b1> DW_AT_ordering : 1 (column major)
<b2> DW_AT_type : <0xa9>
<b6> DW_AT_data_location: 2 byte block: 97 6 (DW_OP_push_object_address; DW_OP_deref)
<b9> DW_AT_allocated : 11 byte block: 97 10 18 22 6 c 1 0 0 0 1a (DW_OP_push_object_address; DW_OP_constu: 24; DW_OP_plus; DW_OP_deref; DW_OP_const4u: 1; DW_OP_and)
<2><c5>: Abbrev Number: 6 (DW_TAG_subrange_type)
<c6> DW_AT_byte_stride : 5 byte block: 97 10 38 22 6 (DW_OP_push_object_address; DW_OP_constu: 56; DW_OP_plus; DW_OP_deref)
<cc> DW_AT_upper_bound : 14 byte block: 97 10 40 22 6 97 10 30 22 6 22 10 1 1c (DW_OP_push_object_address; DW_OP_constu: 64; DW_OP_plus; DW_OP_deref; DW_OP_push_object_address; DW_OP_constu: 48; DW_OP_plus; DW_OP_deref; DW_OP_plus; DW_OP_constu: 1; DW_OP_minus)
<db> DW_AT_lower_bound : 5 byte block: 97 10 40 22 6 (DW_OP_push_object_address; DW_OP_constu: 64; DW_OP_plus; DW_OP_deref)
<2><e1>: Abbrev Number: 0
<1><e2>: Abbrev Number: 0
[-- Attachment #4: pointers.f90 --]
[-- Type: text/plain, Size: 1004 bytes --]
! Copyright 2016 Free Software Foundation, Inc.
!
! This program is free software; you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation; either version 3 of the License, or
! (at your option) any later version.
!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program. If not, see <http://www.gnu.org/licenses/>.
program pointers
integer, target, allocatable, dimension (:) :: intvla
integer, pointer, dimension (:) :: intvlap
nullify (intvlap)
intvlap => intvla
allocate (intvla(10))
intvla(:) = 2
intvla(4) = 4
intvlap => intvla
intvla(1) = intvla(1) + 1 ! After value assignment
end program pointers
next prev parent reply other threads:[~2016-10-17 11:25 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-07 6:38 [PATCH V4 0/6] Fortran: Resolve " Bernhard Heckel
2016-09-07 6:38 ` [PATCH V4 6/6] Fortran: Testsuite, add cyclic pointers Bernhard Heckel
2016-10-13 14:08 ` Yao Qi
2016-09-07 6:38 ` [PATCH V4 3/6] Typeprint: Resolve any dynamic target type of a pointer Bernhard Heckel
[not found] ` <861szvayzg.fsf@gmail.com>
2016-10-05 11:03 ` Bernhard Heckel
2016-10-13 13:41 ` Yao Qi
2016-09-07 6:38 ` [PATCH V4 2/6] Fortran: Resolve dynamic properties of pointer types Bernhard Heckel
2016-10-05 8:44 ` Yao Qi
2016-10-05 9:36 ` Yao Qi
2016-10-05 10:07 ` Bernhard Heckel
2016-09-07 6:38 ` [PATCH V4 1/6] Fortran: Testsuite, fix differences in type naming Bernhard Heckel
2016-09-21 15:57 ` Yao Qi
2016-09-07 6:38 ` [PATCH V4 4/6] Fortran: Typeprint, fix dangling types Bernhard Heckel
2016-10-13 13:53 ` Yao Qi
2016-09-07 6:38 ` [PATCH V4 5/6] Resolve dynamic target types of pointers Bernhard Heckel
2016-09-07 14:24 ` Eli Zaretskii
2016-10-13 14:07 ` Yao Qi
2016-10-13 14:57 ` Bernhard Heckel
2016-10-17 10:32 ` Yao Qi
2016-10-17 11:25 ` Bernhard Heckel [this message]
2016-10-17 12:18 ` Bernhard Heckel
2016-10-20 11:52 ` Bernhard Heckel
2016-10-20 15:33 ` Yao Qi
2016-11-08 7:07 ` Bernhard Heckel
2016-11-08 11:26 ` Yao Qi
2016-11-08 12:27 ` Bernhard Heckel
2016-11-16 12:16 ` Bernhard Heckel
2016-11-21 15:03 ` Bernhard Heckel
2016-09-14 12:55 ` [PING][PATCH V4 0/6] Fortran: Resolve " Bernhard Heckel
2016-09-28 12:45 ` Bernhard Heckel
2016-10-05 6:03 ` [ping 2][PATCH " Bernhard Heckel
2016-09-21 9:49 ` [ping 2] [PATCH " Bernhard Heckel
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=5804B509.7050103@intel.com \
--to=bernhard.heckel@intel.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=qiyaoltc@gmail.com \
/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