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/47240] [F03] segfault with procedure pointer component


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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.01.10 09:23:36
            Summary|segfault with procedure     |[F03] segfault with
                   |pointer component           |procedure pointer component
     Ever Confirmed|0                           |1

--- Comment #2 from janus at gcc dot gnu.org 2011-01-10 09:23:36 UTC ---
Confirmed. There is an additional problem with the following variant:


module element_defs_m
  type tfunc_p
    procedure (dum_tfunc), pointer, nopass :: p => null()
  end type tfunc_p
contains
  function dum_tfunc ( n, x )
    integer, intent(in) :: n
    real, intent(in), dimension(:) :: x
    real, dimension(n,n) :: dum_tfunc
    dum_tfunc = 0
  end function dum_tfunc
end module element_defs_m

program t
   use element_defs_m
   type(tfunc_p) :: tfunc1
   real :: coef (2,2)
   tfunc1%p => dum_tfunc
   call evaluate_tensor_coefficient (tfunc1%p, coef )
   print *, coef
contains
  subroutine evaluate_tensor_coefficient ( tfunc, coef )
    interface
      function tfunc ( n, x )
        integer, intent(in) :: n
        real, intent(in), dimension(:) :: x
        real, dimension(n,n) :: tfunc
      end function tfunc
    end interface
    real, dimension(:,:), intent(out) :: coef
    real :: x(2)=0
    coef = tfunc( n=2, x=x )
  end subroutine evaluate_tensor_coefficient
end program t 


This gives me:

   call evaluate_tensor_coefficient (tfunc1%p, coef )
                                     1
Error: Rank mismatch in argument 'tfunc' at (1) (rank-2 and scalar)


(although the code is valid).


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