This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32319] Bad automatic array argument
- From: "dfranke at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jun 2007 15:57:23 -0000
- Subject: [Bug fortran/32319] Bad automatic array argument
- References: <bug-32319-14178@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from dfranke at gcc dot gnu dot org 2007-06-13 15:57 -------
If you would provide an explicit interface for AA, the binary would not
segfault:
$> cat pr32319.f90
program ff
implicit none
integer,dimension(4)::w
w=1
write(*,*)w
call aa(w(2:3))
write(*,*)w
contains
subroutine aa(v)
integer,dimension(:),intent(out)::v
write(*,*)size(v)
v=0
end subroutine aa
end
$> gfortran-svn pr32319.f90 && ./a.out
1 1 1 1
2
1 0 0 1
Without explicit interface, the binary produced by ifort crashes the same way
as the one generated by gfortran, sunf95 issues this message on the original
code:
$> sunf95 -w4 pr32319.f90
call aa(w(1:5))
^
"pr32319.f90", Line = 13, Column = 1: ERROR: Procedure "AA" is defined at line
1 (pr32319.f90). It must have an explicit interface specified.
--
dfranke at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dfranke at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32319