Reported and confirmed in the fortran mailing list.
test case, trimmed down by Janus:

   implicit none

   type myobj
      real :: myarray(10)
   end type myobj

   real        :: array(10)
   type(myobj) :: obj

   call myfunc(obj,array)

contains

   subroutine myfunc(this, array)
      type(myobj) :: this
      real        :: array(:)
      write (*,*) 'shape bound', shape(this%myarray)
      write (*,*) 'shape input', shape(array)
      write (*,*) shape(array) /= shape(this%myarray) ! SEGFAULT
   end subroutine myfunc

end


-- 
           Summary: Segfault using shape intrinsic function with deferred-
                    shape array
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pchwood at yahoo dot com


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

Reply via email to