Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29267 Discussions

Internal compiler error with bind(C) functionality

Juergen_R_R
Valued Contributor II
491 Views

The following code leads to an ICE with ifx 2025. I do believe that the code itself is fishy though as it also generates ICEs with gfortran and Nagfor. (it also gives an ICE with the latest "classic" ifort.

ifx2025 -c ol_interface.f90
#0 0x0000559f18797b41
#1 0x0000559f187fc457
#2 0x0000559f187e7e5a
#3 0x0000559f188a26a7
#4 0x0000559f1889ef48
#5 0x0000559f188486c9
#6 0x0000559f1884a699
#7 0x0000559f1884ac85
#8 0x0000559f1884d789
#9 0x0000559f1884a699
#10 0x0000559f1884ac85
#11 0x0000559f18848406
#12 0x0000559f1884a699
#13 0x0000559f18847abe
#14 0x0000559f1884a699
#15 0x0000559f186de7db
#16 0x0000559f186de177
#17 0x0000559f188ba704
#18 0x00007fb311b7dd90
#19 0x00007fb311b7de40 __libc_start_main + 128
#20 0x0000559f1851519e

ol_interface.f90(59): error #5623: **Internal compiler error: internal abort** 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.
tmp_fun => dlsym(lib, "ol_f_n_external_" // trim(proc))

2 Replies
jimdempseyatthecove
Honored Contributor III
482 Views

While the ICE shouldn't happen, there is something fishy with your code

...
    function c_dlsym(lib, sym) bind(c,name="dlsym")
...
  function dlsym(lib, sym, fatal) result(f_funp)
...
    use ol_dlfcn, only: dlsym
...
    tmp_fun => dlsym(lib, "ol_f_n_external_" // trim(proc))    

Line 6, which dlsym is intended to be referenced??

The low-case dlsym or the upcase dlsym (Fortran symbols are generated as upcase, but are case insensitive on reference).

Same with line 8.

 

I suggest you change one of the function names (presumably the Fortran name on line 4 and elsewhere where you want to call that function in the Fortran code.).

Jim Dempsey

0 Kudos
Devorah_H_Intel
Moderator
428 Views

@Juergen_R_R  thank you for the report. I was able to reproduce the ICE internally. I am escalating this to our compiler engineering for further investigation. 

0 Kudos
Reply