This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/46978] [4.6 Regression] TRANSPOSE corrupts structure and memory


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

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-12-16 14:48:53 UTC ---
Reduced test case:

program elastic2
  implicit none
  type mesh_t
    real, allocatable, dimension(:,:) :: coor
  end type mesh_t
  type(mesh_t) :: mesh3
  real, allocatable, dimension(:) :: a
  integer :: nno
  nno = 13
  call two(mesh3, nno)
  allocate(a(2*nno))
  a = 1
  mesh3%coor = transpose ( reshape ( a, (/2,nno/) ) )
contains
  subroutine two(x,nno)
    type(mesh_t) :: x
    integer :: nno
    allocate(x%coor(nno,2))
    x%coor = 99
  end subroutine
end program elastic2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]