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

ICE with integer parameter arguament

andrew_4619
Honored Contributor II
329 Views

Using Intel(R) Visual Fortran Compiler 17.0.2.187 [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 17.0.2.187 [IA-32]...
Source1.f90
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.

 

0 Kudos
7 Replies
andrew_4619
Honored Contributor II
329 Views

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

 

0 Kudos
andrew_4619
Honored Contributor II
329 Views

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

 

0 Kudos
andrew_4619
Honored Contributor II
329 Views

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.

0 Kudos
Kevin_D_Intel
Employee
329 Views

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 17.0.4.210 Build 20170428 - PSXE 2017.4.051 / CnL 2017.4.210 - Windows)

0 Kudos
andrew_4619
Honored Contributor II
329 Views

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..... 

0 Kudos
Kevin_D_Intel
Employee
329 Views

Yes, absolutely agree. I escalated it earlier. I really appreciate your simplified test case and will leveraging that further in just a bit.

0 Kudos
Kevin_D_Intel
Employee
329 Views

The fix for this issue is available in the latest PSXE 2017 Update 4 release.

0 Kudos
Reply