I had an ICE with a submodule with a few thousand lines in it which had me scratching my head for a while to find he problem. The problem is C_LOC not being declared in icey() which causes the ICE. In the original I had implicit none (external ) which should have raised a non declared error but didn't as it iced instead. I removed that as it is not required for the reproducer for the ICE. Submodule is also not needed. Could someone test this code on the latest or BETA compiler please as if it still gives an ICE. I will raise a ticket on it if so.
The valid presence of a declaration of C_LOC in subroutine fred is essential for the ICE BTW.
C:\test>type icey.f90 module mice contains subroutine fred(J) use, intrinsic :: iso_c_binding, only: c_loc integer( INT_PTR_KIND() ), intent(out) :: J J = transfer( C_LOC(gchar), J ) end subroutine fred subroutine icey() !use, intrinsic :: iso_c_binding, only: c_loc integer( INT_PTR_KIND() ) :: hret character(256) :: gchar hret = transfer( C_LOC(gchar), hret ) end subroutine icey end module mice C:\test>ifort -c icey.f90 Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on IA-32, Version 18.104.22.168 Build 20200306 Copyright (C) 1985-2020 Intel Corporation. All rights reserved. icey.f90(13): catastrophic error: **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. compilation aborted for icey.f90 (code 1) C:\test>