Bug 1357207

Summary: Fortran allocatable strings debug info type size regression
Product: [Fedora] Fedora Reporter: Jan Kratochvil <jan.kratochvil>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: davejohansen, jakub, jan.kratochvil, jwakely, law, mpolacek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-11 12:07:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Kratochvil 2016-07-16 16:14:20 UTC
Description of problem:
Some GDB testcases started to failing F23->F24.

Version-Release number of selected component (if applicable):
PASS: gcc-5.3.1-2.fc23.x86_64
FAIL: gcc-6.1.1-3.fc24.x86_64

How reproducible:
Always.

Steps to Reproduce:
cat >stringalloc.f90 <<EOH
program stringalloc
  character(len=:), target, allocatable   :: var_char

  allocate(character(len=10) :: var_char)
  var_char = 'foo'
end program stringalloc
EOH
gfortran -o stringalloc stringalloc.f90 -Wall -g;gdb ./stringalloc -batch -ex 'b 5' -ex r -ex 'ptype var_char'

Actual results:
type = PTR TO -> ( character*1 )
 <2><a4>: Abbrev Number: 8 (DW_TAG_variable)
    <a5>   DW_AT_name        : (indirect string, offset: 0x111): var_char
    <a9>   DW_AT_decl_file   : 1
    <aa>   DW_AT_decl_line   : 2
    <ab>   DW_AT_type        : <0xd1>
    <af>   DW_AT_location    : 2 byte block: 91 68      (DW_OP_fbreg: -24)
 <1><d0>: Abbrev Number: 11 (DW_TAG_string_type)
 <1><d1>: Abbrev Number: 6 (DW_TAG_pointer_type)
    <d2>   DW_AT_byte_size   : 8
    <d3>   DW_AT_type        : <0xd0>

Expected results:
type = PTR TO -> ( character*10 )
 <2><4c>: Abbrev Number: 3 (DW_TAG_variable)
    <4d>   DW_AT_name        : (indirect string, offset: 0x111): var_char
    <51>   DW_AT_decl_file   : 1
    <52>   DW_AT_decl_line   : 2
    <53>   DW_AT_type        : <0x7d>
    <57>   DW_AT_location    : 2 byte block: 91 68      (DW_OP_fbreg: -24)
 <1><78>: Abbrev Number: 6 (DW_TAG_string_type)
    <79>   DW_AT_string_length: 2 byte block: 91 64     (DW_OP_fbreg: -28)
    <7c>   DW_AT_byte_size   : 4
 <1><7d>: Abbrev Number: 7 (DW_TAG_pointer_type)
    <7e>   DW_AT_byte_size   : 8
    <7f>   DW_AT_type        : <0x78>

Additional info:
There is also some additional unknown DIE but that does not seem to be related:
 <2><5a>: Abbrev Number: 4 (DW_TAG_variable)
    <5b>   DW_AT_name        : (indirect string, offset: 0x110): .var_char
    <5f>   DW_AT_type        : <0x83>
    <63>   DW_AT_artificial  : 1
    <63>   DW_AT_location    : 2 byte block: 91 64      (DW_OP_fbreg: -28)
 <1><83>: Abbrev Number: 8 (DW_TAG_base_type)
    <84>   DW_AT_byte_size   : 4
    <85>   DW_AT_encoding    : 5        (signed)
    <86>   DW_AT_name        : (indirect string, offset: 0xeb): integer(kind=4)

Comment 1 Jan Kratochvil 2016-08-11 12:07:22 UTC

*** This bug has been marked as a duplicate of bug 1366230 ***