ICE returning abstract interface ifort 13.0.1 20121010

ICE returning abstract interface ifort 13.0.1 20121010

I have an internal compiler error when trying to return a function loaded from a dynamic library using an abstract interface and bindings to dlopen. This occurs on ifort 13.0.1 20121010 (and I believe older versions too). It compiles fine with ifort. This seems related to but not identical to previous problems reported on this forum. Error message and code below.

Thanks!

Joe Zuntz -bash-3.2$ ifort -c test.f90 test.f90: catastrophic error: **Internal compiler error: segmentation violation signal raised** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error

compilation aborted for test.f90 (code 1)

module dynamic_loading
use iso_c_binding
implicit none
interface
function dlopen(file,mode) result(handle) bind(c,name="dlopen")
use iso_c_binding
character(c_char), dimension(*), intent(in) :: file
integer(c_int), value :: mode
type(c_ptr) :: handle
end function
function dlsym(handle,name) result(funptr) bind(c,name="dlsym")
use iso_c_binding
type(c_ptr), value :: handle
character(c_char), dimension(*), intent(in) :: name
type(c_funptr) :: funptr
end function
end interface
abstract interface
function my_function_type(x) bind(c)
use iso_c_binding
integer(c_size_t), value :: x
integer(c_int) :: my_function_type
end function my_function_type
end interface
contains
function load_my_function(library_name, function_name) result(my_function)
character(kind=c_char,len=*) :: library_name, function_name
procedure(my_function_type), pointer :: my_function
type(c_funptr) :: funptr=c_null_funptr
type(c_ptr) :: handle=c_null_ptr
integer(c_int) :: status
handle=dlopen(trim(library_name)//c_null_char, 0)
funptr=dlsym(handle,trim(function_name)//c_null_char)
call c_f_procpointer(funptr, my_function)
end function load_my_function
end module

3 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

Thanks - I have escalated this to the developers as issue DPD200243371.  I am confused by your saying "it compiles fine with ifort" - was there more to that sentence?

Steve - Intel Developer Support

Many thanks, and apologies - I meant that it compiiles fine under gfortran (4.5 and above). 

Kommentar hinterlassen

Bitte anmelden, um einen Kommentar hinzuzufügen. Sie sind noch nicht Mitglied? Jetzt teilnehmen