In the following one assignes a 4x4 array to a 1x1 array. (Reason: transpose()
at the wrong place.)

Expected: This is detected at run time using -fbounds-check
Current result: Crash.

program mat
  implicit none
  complex, allocatable :: a(:,:),b(:,:)
  complex              :: d(1,1)
  allocate(a(4,1),b(4,1))
  a = cmplx(0.5,2.0)
  b = cmplx(2.0,0.5)
  d = matmul(a,transpose(b))
  deallocate(a,b)
end program mat


-- 
           Summary: Bounds check should check size of array: d(1:1,1:1) =
                    a(1:4,1:4)
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tobias dot burnus at physik dot fu-berlin dot de


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

  • [Bug fortran/29572] New:... tobias dot burnus at physik dot fu-berlin dot de

Reply via email to