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

-check all triggers an internal compiler error

MR
Beginner
257 Views

When compiled with -check all with ifort 16.0.2.181 the following code produces and internal compiler error:

module m
 implicit none

contains

 function ftext(text) result(s)
  character(len=*), intent(in) :: text(:)
  integer :: l
  character(len = 6+sum((/(len_trim(text(l)),l=1,size(text))/))) :: s
  character(len=*), parameter :: format = '(a,*(a))'

   write(s,format) &
       'Text: ', ( trim(text(l)) ,l=1,size(text))

 end function ftext

 subroutine s()
  integer :: i
  character(len=1000) :: str
  str = ftext((/"abc"/) )
 end subroutine s

end module m

 

0 Kudos
2 Replies
Kevin_D_Intel
Employee
257 Views

Thank you for the report and convenient reproducer. I can reproduce this with ifort 16.0 but not our newer ifort 17.0 (Beta) so we may already have a known fix coming. I'll investigate a bit further and reply with more details later.

0 Kudos
Kevin_D_Intel
Employee
257 Views

Development was also unable to determine the exact edit responsible for fixing this in 17.0; however, we confirmed it remains fixed in 17.0 source branch and our current development sources, and we added the test case to our internal test suite to ensure it does not regress in the future.

0 Kudos
Reply