Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26730 Discussions

ICE with XE 2020 (19.1) caused by debug info for PARAMETER constants

Andrew_Smith
New Contributor III
140 Views

If was getting:

fortcom: Fatal: There has been an internal compiler error (C0000005).

Using initial relase and update 1 both gave this.

I tried reproducing it in a small project but initially it did not reproduce. Then I tried all my main project settings one by one. Adding PARAMETER debug information caused the same ICE. I removed this setting in my main project and bingo, problem worked around. Just got to live with the restricted debugging help.

0 Kudos
6 Replies
Steve_Lionel
Black Belt Retired Employee
140 Views

Interesting - there was an old bug with similar symptoms. I wonder if your particular source is relevant, or does this happen for any source, even a trivial one?

Andrew_Smith
New Contributor III
140 Views

Here is a cut down reproducer:

module MathsConstants
   use, intrinsic :: iso_fortran_env, only : DP => real64
end module
   
module modInterpolate
   use MathsConstants
   implicit none

   interface
      module subroutine sub1(t)
         use MathsConstants, only: DP
         real(DP), intent(in) :: t
      end
   end interface
   
contains

subroutine sub2(x)
   real(DP), intent(inout) :: x
end

end module

 

Andrew_Smith
New Contributor III
140 Views

Now I can see what was confusing, I can remove the second use statement

Steve_Lionel
Black Belt Retired Employee
140 Views

Yep - I can reproduce with that in 19.1.1 but not 19.1.0. Please file a ticket on that.

When you say you can remove the second use statement, do you mean the one before "implicit none" or the one in the interface block? You can't remove either of those. The one before "implicit none" provides the definition of DP used in sub2. The one in the interface block is needed because interfaces are a "window" into the actual procedure and there is no host association. You could replace that with an IMPORT, however.

FortranFan
Honored Contributor II
140 Views

Steve Lionel (Ret.) (Blackbelt) wrote:

.. The one in the interface block is needed because interfaces are a "window" into the actual procedure and there is no host association. You could replace that with an IMPORT, however.

Re: "The one in the interface block is needed because interfaces are a "window" into the actual procedure and there is no host association. You could replace that with an IMPORT, however," I don't think this is correct.

The reproducer in Quote #3 shows a MODULE prefix to subroutine 'SUB1' thus making it a separate module procedure (per Fortran standard terminology) and per the semantics laid out in the standard when SUBMODULEs were introduced starting Fortran 2008, the named constant 'DP' should be accessible via host association if I recall correctly.

I'll look into this later when I find time.

Steve_Lionel
Black Belt Retired Employee
140 Views

You are correct - I forgot that bit about submodules.

Reply