This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/28129] New: gfortran -fbounds-check: Shows invalid array out of bounds error
- From: "tobias dot burnus at physik dot fu-berlin dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jun 2006 20:44:52 -0000
- Subject: [Bug fortran/28129] New: gfortran -fbounds-check: Shows invalid array out of bounds error
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
(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