[Bug fortran/35971] ICE on valid code with C_FUNPTR and transfer

2008-10-20 Thread janus at gcc dot gnu dot org


--- Comment #3 from janus at gcc dot gnu dot org  2008-10-20 12:02 ---


*** This bug has been marked as a duplicate of 36463 ***


-- 

janus at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE


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



[Bug fortran/35971] ICE on valid code

2008-06-29 Thread janus at gcc dot gnu dot org


--- Comment #2 from janus at gcc dot gnu dot org  2008-06-29 08:58 ---
The test case in comment #1 does compile for me without any ICE. The test case
in comment #0 is actually invalid, triggering the following error message:

  procedure(abstract_fun) fun
  1
Error: PROCEDURE at (1) must be in a generic interface

One simply has to remove the interface statement from the main program:

program fptr
   use funcs
   use other_fun
   implicit none
   procedure(abstract_fun) fun
   pointer(p,fun)
   type(C_FUNPTR) fp

   fp = get_proc('Hello, world'//achar(0))
   p = transfer(fp,p)
   write(*,'(a)') fun([1,2,3])
end program fptr

With this I also get an ICE.


-- 


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



[Bug fortran/35971] ICE on valid code

2008-04-20 Thread tkoenig at gcc dot gnu dot org


--- Comment #1 from tkoenig at gcc dot gnu dot org  2008-04-20 21:19 ---
Confirmed.

Reduced testcase:

module other_fun
   use ISO_C_BINDING
   implicit none
   private
! Message to be returned by procedure pointed to
! by the C_FUNPTR
   character, allocatable, save :: my_message(:)
! Interface block for the procedure pointed to
! by the C_FUNPTR
   public abstract_fun
   abstract interface
  function abstract_fun(x)
 use ISO_C_BINDING
 import my_message
 implicit none
 integer(C_INT) x(:)
 character(size(my_message),C_CHAR) abstract_fun(size(x))
  end function abstract_fun
   end interface
   contains

! Intermediate procedure to pass the function and get
! back the C_FUNPTR
  function get_funloc(x,y)
 procedure(abstract_fun) x
 type(C_FUNPTR) y
 external y
 type(C_FUNPTR) get_funloc

 get_funloc = y(x)
  end function get_funloc
end module other_fun


-- 

tkoenig at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2008-04-20 21:19:39
   date||


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