- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Now I can see what was confusing, I can remove the second use statement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are correct - I forgot that bit about submodules.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page