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

            Bug ID: 83209
           Summary: Failure of allocation of a coarray with a pointer
                    component
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pault at gcc dot gnu.org
                CC: vehre at gmx dot de
  Target Milestone: ---

Created attachment 42740
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42740&action=edit
tree dump of failing test

integer, target :: tgt = 45
  type :: t
    integer, pointer :: i => tgt
  end type
  type(t), allocatable :: c(:)[:]

  allocate(c(10)[*])
  deallocate(c)
end

fails with:

[pault@pc30 pr83076]$ ~/irun/bin/gfortran -static-libgfortran test.f90 
-fdump-tree-original -O3 -fcoarray=lib -lcaf_single -g
[pault@pc30 pr83076]$ ./a.out
At line 8 of file test.f90
Fortran runtime error: Attempt to DEALLOCATE unallocated 'c'

Error termination. Backtrace:
#0  0x4029f4 in MAIN__
        at /home/pault/prs/pr83076/test.f90:8
#1  0x4029f4 in main
        at /home/pault/prs/pr83076/test.f90:9


The tree dump is attached.

The version with an allocatable component works as expected.

Paul

Reply via email to