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

get an ICE when compile with -check shape with an abstract procedure

ur
New Contributor II
1,195 Views

This program, greatly reduced, gets an ICE if the -check shape option
(originally it was -check all) is used, and the length of func is the
expression len(str); but if it is a constant it compiles.

       ifort -c mainice.f90 -check shape
      exit

mainice.f90(1): 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 mainice.f90 (code 1)

program main
implicit none
abstract interface
    function func (str)
      character(len=*), intent (in) :: str
      !=======================================
      character(len=len(str)) :: func ! <= this fails to compile
      !character(len=52) :: func ! <= this compiles
      !=======================================
   end function func
end interface
procedure (func), pointer :: f_ptr => null()
    f_ptr => upper7
    !print *, f_ptr('AbCdEfGhIjKlMnOpQrStUvWxYz1234567890')
contains


pure function upper7(str) result(string)
character(*), intent(in) :: str
character(len(str)) :: string
     string=str
end function upper7

end program main

1 Solution
Barbara_P_Intel
Employee
1,127 Views

Once again, thank you of the nice reproducer. I filed a bug on this CMPLRIL0-35243.

You note one workaround in the reproducer. The other is to use ifx. ifx compiles it just fine.

 

 

View solution in original post

0 Kudos
3 Replies
Barbara_P_Intel
Employee
1,128 Views

Once again, thank you of the nice reproducer. I filed a bug on this CMPLRIL0-35243.

You note one workaround in the reproducer. The other is to use ifx. ifx compiles it just fine.

 

 

0 Kudos
ur
New Contributor II
1,114 Views

Interesting. First time I had problems with ifort but not ifx that were not run-time. Does work fine with ifx. Slowly switching over ...

0 Kudos
Barbara_P_Intel
Employee
940 Views

I closed the bug report since you have a workaround for ifort AND ifx works ok.



0 Kudos
Reply