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/28129] New: gfortran -fbounds-check: Shows invalid array out of bounds error


(This PR should probably added as dependency to bug 27766)

This is with my GCC/gfortran build x86_64-2006-06-21-r114837.

If I run the following program, which I think is completely valid, with
  gfortran -fbounds-check
I get:
  Fortran runtime error: Array reference out of bounds, upper bound of
  dimension 2 exceeded (in file 'gftest.f90', around line 2)

However, I think the program (see below) is completely valid and it also works
flawlessly with all checks turned on with NAG f95 and ifort. (And with gfortran
and no checks it does not crash.)

-------------------------------------
subroutine wavefmt(ld,wfmt)
  implicit none
  integer, intent(in) :: ld
  complex(8), intent(out) :: wfmt(ld,*)
  wfmt(:,1)=0.d0
end subroutine wavefmt

program test
  implicit none
  integer, parameter :: lmmaxvr = 64, nrcmtmax = 107
  complex(8), allocatable :: wfmt1(:,:)
  allocate(wfmt1(lmmaxvr,nrcmtmax))
  call wavefmt(lmmaxvr,wfmt1)
end program test
-------------------------------------


-- 
           Summary: gfortran -fbounds-check: Shows invalid array out of
                    bounds error
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tobias dot burnus at physik dot fu-berlin dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28129


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