Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
82 Views

"internal compiler error" at name conflict

Jump to solution

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

Accepted Solutions
Highlighted
Black Belt Retired Employee
61 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.

--
Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran

View solution in original post

0 Kudos
4 Replies
Highlighted
Moderator
75 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
Highlighted
Black Belt
74 Views

Try

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

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

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

--
Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran

View solution in original post

0 Kudos
Highlighted
Beginner
32 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