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

internal compiler error when initializing


This program produced the error message below it when compiled with ifort 17.0-1589

module qpcomplex
  implicit none
  integer,parameter :: qp = selected_real_kind(30)
  real(qp),parameter:: two = 2
  complex(qp),parameter:: qpi = cmplx(0,1,kind=qp)
end module qpcomplex

program prog
  use qpcomplex, only: qp,qpi,two
  implicit none
  integer:: j,n
  complex(qp):: z,zseries(30) = [(cmplx(n,0,qp)/two,n=1,10),&
       (-1.4_qp+qpi*j/two,j=0,9), (1.4_qp-qpi*j/two,j=0,9)]
  do j = 1,size(zseries)
     z = zseries(j)
     print "(SP,A,F37.33,A,F37.33,A)", '(',real(z),',',aimag(z),')'
  end do
end program prog

 Intel(R) Fortran 17.0-1589
iforttest2.f90(13): error #6973: This is not a valid initialization expression.
       (-1.4_qp+qpi*j/two,j=0,9), (1.4_qp-qpi*j/two,j=0,9)]
iforttest2.f90: catastrophic error: **Internal compiler error: segmentation violation signal raised** 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 iforttest2.f90 (code 1)

0 Kudos
1 Reply
Valued Contributor I

The code does not have any problems with any compiler that I have at hand, including ifort 17.0.8, ifort 18.0.5 or ifort 19.0.1. An ICE is a compiler bug, yes, but obviously it has been fixed even in the v17 of ifort. So why don't you just upgrade?

0 Kudos