Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor II
37 Views

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

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
Highlighted
Black Belt Retired Employee
37 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?

0 Kudos
Highlighted
New Contributor II
37 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

 

0 Kudos
Highlighted
New Contributor II
37 Views

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

0 Kudos
Highlighted
Black Belt Retired Employee
37 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.

0 Kudos
Highlighted
Valued Contributor III
37 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.

0 Kudos
Highlighted
Black Belt Retired Employee
37 Views

You are correct - I forgot that bit about submodules.

0 Kudos