Using Intel(R) Visual Fortran Compiler 18.104.22.168 [IA-32] I have a number of ICE's the first one a have reduced to a simple case that replicates the problem:
module ice implicit none integer, parameter :: ld=82 contains subroutine thingy character(ld) :: gch integer :: l1 l1 = unpad(gch,ld) end subroutine thingy function unpad(gbuf,ipad) integer :: unpad integer, intent(in) :: ipad character(len=ipad) :: gbuf gbuf = adjustl(gbuf) unpad = len_trim(gbuf) end function unpad end module ice
Configuration: Debug|Win32 ------
Compiling with Intel(R) Visual Fortran Compiler 22.214.171.124 [IA-32]...
fortcom: Fatal: There has been an internal compiler error (C0000005).
The line that causes the ICE is "l1 = unpad(gch,ld)". If the parameter LD is defined in "thingy" rather than module ICE it compiles OK.
A shorter example
module ice implicit none integer, parameter :: ld=82 contains subroutine thingy call bob(ld) end subroutine thingy subroutine bob(I) integer,intent(in) :: I print *, I end subroutine bob end module ice
An for what it is worth this case DOES NOT cause an ICE
module set_parm implicit none integer, parameter :: ld=82 end module set_parm module ice use set_parm implicit none contains subroutine thingy call bob(ld) end subroutine thingy subroutine bob(I) integer,intent(in) :: I print *, I end subroutine bob end module ice
It transpired that all the ICEs relate to this one problem. Given you have API or resource file constants as parameters that in a module that can then get used as call args this problem can occur many times.
Thank you for your time/efforts to report and isolate this error. It took a few tries but I finally reproduced this. It occurs in combination with throwing /debug:full and any level of /debug-parameters (i.e. all or used). Its avoidable by not using any variant of /debug-parameter with /debug:full, or using /debug:minimal with any variant of /debug-parameter.
I escalated this defect to Development.
(Internal tracking id: DPD200418283)
(Resolution Update on 05/12/2017): This defect is fixed in the Intel® Parallel Studio XE 2017 Update 4 release (ifort Version 126.96.36.199 Build 20170428 - PSXE 2017.4.051 / CnL 2017.4.210 - Windows)
This probably doesn't need saying but I suggest DPD200418283 needs to be high on the list priorities for fixes in update 3 as it seems to be wreaking havoc with many users judging by the significant number related forum posts.....