This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31119] New: Bogus "array abound mismatch" for -fbounds-check
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Mar 2007 08:39:26 -0000
- Subject: [Bug fortran/31119] New: Bogus "array abound mismatch" for -fbounds-check
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following program produces the wrong error:
ivec_= 1 2
Fortran runtime error: Array bound mismatch, size mismatch for dimension 1 of
array 'ivec' (in file 'x.f90', at line 20)
with -fbounds-check.
Taken from:
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/b8313f7232d8a5f5/
module sub_mod
contains
elemental subroutine set_optional(i,idef,iopt)
! set i to (iopt,idef) if iopt (is,is not) PRESENT
integer, intent(out) :: i
integer, intent(in) :: idef
integer, intent(in), optional :: iopt
if (present(iopt)) then
i = iopt
else
i = idef
end if
end subroutine set_optional
!
subroutine sub(ivec)
integer , intent(in), optional :: ivec(:)
integer :: ivec_(2)
call set_optional(ivec_,(/1,2/))
print*,"ivec_=",ivec_
call set_optional(ivec_,(/1,2/),ivec)
print*,"ivec_=",ivec_
end subroutine sub
end module sub_mod
program main
use sub_mod, only: sub
call sub()
end program main
--
Summary: Bogus "array abound mismatch" for -fbounds-check
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: wrong-code, diagnostic
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
OtherBugsDependingO 27766
nThis:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31119