It appears I am receiving an internal compiler error when using a user defined operator with the incorrect type.
I am receiving the following error when compiling with pgfortran (versions 14.2 and 14.6). I am only using the ‘-c’ flag. The error also occurs when compiling in debug mode (’-g’ flag).
ILM FILE line 146: Bad ilm operand 0
PGF90-F-0000-Internal compiler error. Errors in ILM file 1 (main.f90: 19)
!operator.f90 module operator implicit none interface operator (.match.) module procedure is_match end interface contains function is_match(a,b) result(match) real, intent(in) :: a, b logical :: match if (a == b) match =.true. end function end module
!main.f90 program main use operator implicit none real :: a,b double precision :: c, d a = 2.0 b = 3.0 if (a .match. b) print *, 'A and B Match' c = 2d0 d = 2d0 if (c .match. d) print *, 'C and D Match' end program
The compiler error occurs when the following line is included. When this line is commented out, the error does not appear. You can see that the .match. operator is being used incorrectly since i am applying it to two double precision variables. The operator is expecting two real values. I expect that the compiler should catch this error.
if (c .match. d) print *, ‘C and D Match’