[Bug fortran/38135] FORALL gives wrong result

tkoenig at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Nov 15 17:20:00 GMT 2008



------- Comment #2 from tkoenig at gcc dot gnu dot org  2008-11-15 17:19 -------
$ cat foo.f90
integer, parameter :: N = 3
integer A(N,N)
A(1:N,1:N)=reshape(A(1:0,1),(/N,N/),reshape((/1/),(/N+1/),(/2/)))
write(*,'(3i5)') A
write(*,'(4i5)') reshape([1],[N+1],[0])
end
$ gfortran -fbounds-check foo.f90
$ ./a.out
Fortran runtime error: Incorrect size in SOURCE argument to RESHAPE intrinsic:
is 0, should be 9

A false positive for bounds checking as well, it appears.


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tkoenig at gcc dot gnu dot
                   |                            |org


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



More information about the Gcc-bugs mailing list