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

(another) ICE with 11.1.064

Alexis_R_
New Contributor I
648 Views

This may or may not be related to this other ICE.

[fortran]module test_mod

	ABSTRACT INTERFACE
		PURE REAL FUNCTION INTERPOLATION_FUNCTION(ARG)
			REAL,	INTENT(IN)	::	ARG
		END FUNCTION INTERPOLATION_FUNCTION
	END INTERFACE

	CONTAINS

	!>	\brief	Returns a pointer to the function described by the text string
	FUNCTION FIND_INTERPOLATION_FUNCTION(DESCRIPTION)
		IMPLICIT NONE
		! Arguments
		CHARACTER(LEN=*),	INTENT(IN)	::	DESCRIPTION
		! Result
		PROCEDURE(INTERPOLATION_FUNCTION), POINTER	::	FIND_INTERPOLATION_FUNCTION
		! Private variables

		! Start work
		SELECT CASE (TRIM(DESCRIPTION))
			CASE ('SINC')
				FIND_INTERPOLATION_FUNCTION => SINC
			CASE DEFAULT
				WRITE(*,'(2A)') '**ERROR(FIND_INTERPOL_FUNCTION): could not work out what function you were looking for. ', TRIM(DESCRIPTION)
				STOP 'Fatal error in FIND_INTERPOL_FUNCTION'
		END SELECT
	END FUNCTION FIND_INTERPOLATION_FUNCTION

	PURE REAL FUNCTION SINC(ARG)
		IMPLICIT NONE
		REAL, INTENT(IN)	::	ARG
		! Private variables
		REAL	::	ARG2
		! Start work
		ARG2 = ARG
		IF (ABS(ARG2) .LE. 1.0E-6) THEN
			SINC = 1.0
		ELSE
			SINC = SIN(ARG2)/ARG2
		ENDIF
	END FUNCTION SINC

end module test_mod

program hello
	use test_mod
	implicit none
end program hello[/fortran]

Compiling this with ifort 11.1.064 gives this:

[bash]% ifort -c helloworld.f90
0_12032

: catastrophic error: **Internal compiler error: internal abort** 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 helloworld.f90 (code 3)[/bash]

I'm not completely sure whether what I am doing is legal fortran - this is the first time I am writing a function where the result is a pointer to a function defined by an abstract interface. But either way, an ICE is not nice.

Do let me know if this is not legal Fortran - thanks.

0 Kudos
5 Replies
Steven_L_Intel1
Employee
648 Views
I believe what you are doing is legal, and it is the same issue as the other thread. The compiler does not like to see a function whose return type is specified by PROCEDURE(),POINTER.
0 Kudos
Alexis_R_
New Contributor I
648 Views

Thanks - the reason I reported this separately is because when I commented out the SELECT CASE construct, compilation went fine as far as I remember.

0 Kudos
Steven_L_Intel1
Employee
648 Views
Interesting...
0 Kudos
Alexis_R_
New Contributor I
648 Views
Not sure I like the sound of that :) I'm hoping this won't be a case of waiting for the next major release, but it sounded from the other thread that this might be the case...?
0 Kudos
Steven_L_Intel1
Employee
648 Views
This is the sort of issue we try to fix in a monthly update. I said interesting because it makes me wonder what's really going on where removing the SELECT CASE causes the error to hide. In any event, I have given the developers all your test cases and they'll chew on it.
0 Kudos
Reply