This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/82056] New: Automatic array can be sized via allocatable array


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

            Bug ID: 82056
           Summary: Automatic array can be sized via allocatable array
           Product: gcc
           Version: 6.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: arjen.markus at deltares dot nl
  Target Milestone: ---

The following program is accepted without complaints from the compiler:

module chkdim
    implicit none

contains

subroutine calculate
    real, dimension(:), allocatable :: x
    real, dimension(size(x))        :: y

    write(*,*) 'Sizes:', size(x), size(y)
end subroutine calculate
end module chkdim

program chkit
    use chkdim

    call calculate
end program chkit

The problem however is that by relating the size of the automatic array (y) to
that of a (local) allocatable array, the size of y is essentially undetermined.

Ideally, the compiler should issue an error or a warning about it.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]