- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
링크가 복사됨
5 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
