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

"internal compiler error" at name conflict

AAK
Novice
851 Views

Hi,

I got an catastrophic error: **Internal compiler error: internal abort** on the example module below:

module error
implicit none

type :: mytype
contains
procedure, pass, public :: mylogical
end type

contains

subroutine mysub(this)
type(mytype), intent(inout) :: this
logical mylogical
mylogical = .true.
if(.not.this%mylogical) write(*,*) 'blah'
end subroutine mysub

function mylogical(this) result(res)
class(mytype), intent(in) :: this
logical :: res
res=.true.
end function

end module error

 

Version:

ifort --version
ifort (IFORT) 19.0.4.243 20190416
Copyright (C) 1985-2019 Intel Corporation. All rights reserved.

 

However, the above code compiles without error upon removing  ".not." in the routine mysub.

 

0 Kudos
1 Solution
Steve_Lionel
Honored Contributor III
830 Views

As Ron suggests, referencing a function without an argument list (even if empty) is not allowed by the language.

R1520 function-reference is procedure-designator ( [ actual-arg-spec-list ] )

As you can see from the syntax rule, the parentheses are required.

View solution in original post

0 Kudos
4 Replies
Ron_Green
Moderator
844 Views

With compiler 19.1.x your example gets a error message and does not crash the compiler:

ifort -c -V repro.f90
Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.1.0.166 Build 20191121
Copyright (C) 1985-2019 Intel Corporation. All rights reserved.

Intel(R) Fortran 19.1-1555
repro.f90(15): error #8497: Illegal use of a procedure name in an expression, possibly a function call missing parenthesis. [MYLOGICAL]
if(.not.this%mylogical) write(*,*) 'blah'
-------------^

 

If I change your syntax to:

if(.not.this%mylogical()) write(*,*) 'blah'
!... note the parens  ^^ here that the compiler wants

 

I can check The Standard to see if this is correct if I get a chance in a couple of days - it's low priority since we have a workaround ( change the syntax, use a 19.1 or newer compiler).   I recommend keeping up to date with the compilers.  19.1 has a lot more Fortran Standard implemented, bug fixes, and warning/error messages in syntax checking. 

 

0 Kudos
Steve_Lionel
Honored Contributor III
831 Views

As Ron suggests, referencing a function without an argument list (even if empty) is not allowed by the language.

R1520 function-reference is procedure-designator ( [ actual-arg-spec-list ] )

As you can see from the syntax rule, the parentheses are required.

0 Kudos
AAK
Novice
801 Views

Thank you for your fast answers. I was fully aware of the missing parenthesis, though I should have mentioned it in the post.
I just wanted to report the internal compiler error, as I thought would be something you guys would be interested in, although - as Ronald_G_Intel said - it is low priority. I do not have the newer compiler versions jet.

0 Kudos
mecej4
Honored Contributor III
843 Views

Try

     if(.not.this%mylogical()) write(*,*) 'blah'

That is, add '()' after the function name.

0 Kudos
Reply