**Internal compiler error: segmentation violation with INTERFACE BLOCK

**Internal compiler error: segmentation violation with INTERFACE BLOCK

Any reason why this should produce a compiler segmentation. I have 2 files junk1_mod.F90 and Interfaces_mod.F90.So I compile
ifort -c junk1_mod.F90 <--- no problem here
when I compile Interfaces_mod.F90
ifort -c Interfaces_mod.F90

/tmp/ifortVR4J0A.i90: catastrophic error: **Internal compiler error: segmentation violation signal raised** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error.

compilation aborted for Interfaces_mod.F90 (code 1)

???? The odd part is the message went away if I just take out the type bound procedure definition junksub ni junk1_mod.F90.

Now if I just include the interface block inside another routine, that seems to be OK as well, but that would be a pain.

I have tried this on other compiler like xlf2003 w/o any problem.

This occurs even with either the latest 11.1 compiler or the 12.0 beta compiler.

=== file junk1_mod.F90

module junk1_mod

type :: junktype

integer :: i

contains

procedure junksub

end type junktype

contains

subroutine junksub(this,i)

class(junktype) :: this

integer :: i

end subroutine junksub

end module junk1_mod

=== file Interfaces_mod.F90

module Interfaces_mod

INTERFACE

subroutine test( junk )

use junk1_mod

type(junktype) :: junkin

end subroutine test

END INTERFACE

end module Interfaces_mod

7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The nearly universal answer to an internal compiler error is "it's a compiler bug". Thanks - we'll take a look at this.

Retired 12/31/2016

Thanks for the nice test case. I have escalated this as issue DPD200161456. When I get any news about it, I will reply here.

Retired 12/31/2016

Thank you Steve... in the meantime I will try to find a way to work around this problem.

Best Reply

As a workaround, you could put an import statement inside the interface block, and move the use statement outside the interface block:

module Interfaces_mod

    use junk1_mod

    INTERFACE
        subroutine test( junk )
            import
            type(junktype) :: junk
        end subroutine test
    END INTERFACE

end module Interfaces_mod

Thanks John... that seems to work. Although since my real code is a lot more involved with lots of routines in the interface blocks and lots of modules to be included, it would be a little messy, but I may just have to do that or redesign the code to use all TPB and not have this issues at all.

This was fixed in version 12 Update 1.

Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today