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

            Bug ID: 88624
           Summary: [Coarray] Rejects allocatable coarray passed as a
                    dummy argument
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: m.modrzejewski at student dot uw.edu.pl
  Target Milestone: ---

The compiler rejects a program where an allocatable coarray is passed to a
subroutine as an allocatable dummy argument, and then passed again as an
argument to another subroutine.

Here's a minimum example which doesn't compile with gfortran 8.2.0:

program test 
      implicit none 
      integer, parameter :: F64 = selected_real_kind(p=15, r=307) 
      real(F64), dimension(:), allocatable :: x[:] 
      call g(x) 
      if (this_image()==1) then 
            print *, x 
      end if 
contains 
      subroutine g(x) 
            real(F64), dimension(:), allocatable :: x[:] 
            allocate(x(10)[*]) 
            call g2(x) 
      end subroutine g 
      subroutine g2(x) 
            real(F64), dimension(:) :: x[*] 
            integer :: k 
            do k = 1, 10 
                  x(k) = 2.0_F64 * this_image() 
            end do 
      end subroutine g2 
end program test 

The following error message appears: 

$ gfortran-8 -fcoarray=lib example-gfortran.f90 -lcaf_mpi 
example-gfortran.f90:13:0: 

             call g2(x) 

internal compiler error: in gfc_conv_procedure_call, at
fortran/trans-expr.c:5866 

The compilation completed without any errors when using the flag
-fcoarray=single. The Intel Fortran compiler doesn't see any problem here.

Regards,
Marcin

Reply via email to