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

--- Comment #7 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2010-12-12 
16:37:48 UTC ---
The patch in comment #5 fixes this PR, but the tests in pr41278, pr44912, and
the variant below of pr40646 yields ICEs:

"in proc_call_can_redefine_sym, at fortran/trans-expr.c:5411" for (variant of
pr40646 and pr44912)
or "pr41278.f90:10:0: internal compiler error: Segmentation fault".

! { dg-do run }
!
! PR 40646
!
! array-valued PPCs
!
! Original test case by Charlie Sharpsteen <ch...@sharpsteen.net>
! Modified by Janus Weil <ja...@gcc.gnu.org>

module bugTestMod
  implicit none
  type:: boundTest
    procedure(returnMat), pointer, nopass:: test
  end type boundTest
contains
  function returnMat( a, b ) result( mat )
    integer:: a, b
    double precision, dimension(a,b):: mat 
    mat = 1d0
  end function returnMat
end module bugTestMod

program bugTest
  use bugTestMod
  implicit none
  type( boundTest ):: testObj
  double precision, dimension(2,2):: testCatch
  testObj%test => returnMat
  testCatch = testObj%test(2,2)
  print *,testCatch
  if (sum(testCatch)/=4) call abort()
end program bugTest

! { dg-final { cleanup-modules "bugTestMod" } }

Reply via email to