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

Internal compiler error with SPREAD function

Alice_Faure
Beginner
831 Views

Good morning,

I recently encountered an ICE (catastrophic error: **Internal compiler error: segmentation violation signal raised**) when trying to compile this code in modern Fortran with ifort 19.1.3.304. With gfortran it compiles without error.

If I replace n-1 by its value in the spread function it compiles without error with ifort as well.

 

  program test

  implicit none

  integer, parameter :: n = 5
  real :: array(n) = [1, spread(2,1,n-1)]

  ...

  end program

 

Thank you,

Alice

0 Kudos
6 Replies
FortranFan
Honored Contributor II
809 Views

@Alice_Faure ,

If you have access to Intel Online Support Center (OSC), please submit a support request with a high priority - see below also as to why:

https://supporttickets.intel.com/servicecenter?lang=en-US

So you may know Intel now offers Intel oneAPI toolkits where Fortran compilers - IFORT classic and new  IFX - are free.  oneAPI 2021.3 is the latest offering:

https://community.intel.com/t5/Intel-Fortran-Compiler/AVAILABLE-NOW-oneAPI-2021-3-Release/m-p/1298866#M156821

What you will find is the ICE you report with SPREAD is not encountered with this 2021.3 Release but there is another problem which a Fortranner might see as far worse i.e., the wrong result is produced:

   integer, parameter :: n = 5
   real :: a(n) = [ 1, spread(2,1,n-1) ]
   print *, "a = ", a
end
C:\Temp>ifort /standard-semantics a.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.3.0 Build 20210609_000000
Copyright (C) 1985-2021 Intel Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 14.29.30038.1
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:a.exe
-subsystem:console
a.obj

C:\Temp>a.exe
 a =  1.000000 0.000000 0.000000 0.000000 0.000000

C:\Temp>

Hence my hope this can be brought to Intel's attention and for the Intel Fortran team to review the issue urgently.  These are the kind of troubling issues where a software provider ideally will deliver a hotfix.  Unfortunately that does not seem to be part of the Intel workflow with IFORT.

 

0 Kudos
Alice_Faure
Beginner
774 Views

@FortranFan , thank you for your answer. Following your suggestion I tried submitting it to the OSC but I got this message :

"Support for the product selected is through the Intel Community Forums."

And it was impossible to send my support request.

0 Kudos
Barbara_P_Intel
Moderator
756 Views

Good to know the ICE is fixed in oneAPI 2021.3.0!   Let me check the runtime error.

 

0 Kudos
Barbara_P_Intel
Moderator
742 Views

Another developer reported this runtime issue recently. I added your reproducer to the existing bug. I'll let you know its progress to a fix.



0 Kudos
Barbara_P_Intel
Moderator
556 Views

The internal compiler error reported using SPREAD() is fixed in the Fortran compiler that was released this week. ifort 2021.5.0 is part of oneAPI HPC Toolkit 2022.1.  AND SPREAD() does the right thing.

Please try it out!

HAPPY HOLIDAYS!

 

0 Kudos
Alice_Faure
Beginner
442 Views

I tested it, it works perfectly. Thank you very much !

0 Kudos
Reply