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

Parameter definition including SUM of another parameter

wtdailey
Beginner
512 Views

I'm encountering a compiler error when defining a named constant (parameter) using the SUM intrinsic on another previously declared named constant (parameter).  When compiling the following with IFX 2024.2.1 20240711,...

program computed_parameter_test
    implicit none
    real, parameter :: xy(1:2) = (/ 1.0 , 2.0 /)
    real, parameter :: zz(1:2) = xy / sum(xy)

    write(*,*) 'xy=',xy
    write(*,*) 'zz=',zz
end program

... I get:

compute_parameter_test.f90(4): internal error: Please visit 'http://www.intel.com/software/products/support' for assistance.
    real, parameter :: zz(1:2) = xy / sum(xy)
^
compute_parameter_test.f90(4): catastrophic error: Internal Compiler Error: Ref module: ffe_ccvt.c
compilation aborted for compute_parameter_test.f90 (code 1)

 This does not occur with the use of other intrinsics (that I've tried) in the definition of the parameter 'zz' on line 4.  IFORT previously compiled without error (gfortran also compiles without error).  Is this use of SUM allowed?

Labels (1)
3 Replies
Steve_Lionel
Honored Contributor III
464 Views

Yes, it's allowed. Internal Compiler Error is always a compiler bug, whether or not the usage is correct.

wtdailey
Beginner
389 Views
Thanks for the reply Steve.

Let me know if I can provide any further info or documentation to help the development team! Cheers.
0 Kudos
Devorah_H_Intel
Moderator
293 Views

I was able to reproduce the ICE. Thank you for reporting this to us, @wtdailey. Intel Compiler Engineering will investigate and fix it in future ifx releases.

0 Kudos
Reply