This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31320] Illegal read with gfortran.dg/alloc_comp_assign_2.f90 and *_3.f90
- 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: 5 Jul 2007 16:09:19 -0000
- Subject: [Bug fortran/31320] Illegal read with gfortran.dg/alloc_comp_assign_2.f90 and *_3.f90
- References: <bug-31320-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from dfranke at gcc dot gnu dot org 2007-07-05 16:09 -------
Some more examples. Uncomment either assignment to 'y' to have valgrind report
the errors indicated at the end of the line:
type :: a
integer, allocatable :: i(:)
end type a
type(a) :: x, y
x = a ((/ 1,2,3 /))
! y = a (x%i(1:3)) ! ok
! y = a (x%i(1:)) ! invalid read
! y = a (x%i(:3)) ! invalid read
! y = a (x%i(:)) ! invalid read, memory leak
! y = a (x%i) ! invalid read, memory leak
! y = x ! invalid read
end
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31320