(another) ICE with 11.1.064

(another) ICE with 11.1.064

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

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

Compiling this with ifort 11.1.064 gives this:

% 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)

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.

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

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.

Steve - Intel Developer Support

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.

Interesting...

Steve - Intel Developer Support

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...?

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.

Steve - Intel Developer Support

Leave a Comment

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