[Bug fortran/64613] New: <incomplete type> allocatable array after 4.7

ql.le at hotmail dot com gcc-bugzilla@gcc.gnu.org
Thu Jan 15 13:24:00 GMT 2015


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

            Bug ID: 64613
           Summary: <incomplete type> allocatable array after 4.7
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ql.le at hotmail dot com

A small code to test:

```
integer :: x(2,3)
integer, allocatable :: y(:,:)

allocate(y(2,3))

x = reshape([1,2,3,4,5,6], [2,3], order=[2,1])
y = reshape([1,2,3,4,5,6], [2,3], order=[2,1])

print *, 'x', transpose(x)
print *, 'y', transpose(y)

end
```

On 4.7, gdb works fine with both x and y

```
[qlle@(none) ~]$ gdb --version | head -n1
GNU gdb (GDB) Fedora (7.4.50.20120120-54.fc17)
[qlle@(none) ~]$ gfortran --version | head -n1
GNU Fortran (GCC) 4.7.2 20120921 (Red Hat 4.7.2-2)

(gdb) i lo
x = (( 1, 4) ( 2, 5) ( 3, 6) )
y = (( 1, 4) ( 2, 5) ( 3, 6) )
(gdb) p y(:,2)
$1 = (2, 5)
(gdb) p y(2,:)
$2 = (4, 5, 6)
(gdb) show language 
The current source language is "auto; currently fortran".
```

However on 4.9, `<incomplete type>` was shown instead:

```
~/Downloads❯ gdb --version | head -n 1
GNU gdb (GDB) 7.8.1

~/Downloads❯ gfortran --version | head -n1
GNU Fortran (Homebrew gcc 4.9.2_1) 4.9.2

~/Downloads❯ gdb a.out
...
(gdb) break 9
Breakpoint 1 at 0x100000b41: file alloc.f90, line 9.
run
...
(gdb) info locals
x = (( 1, 4) ( 2, 5) ( 3, 6) )
y = <incomplete type>
```


More information about the Gcc-bugs mailing list