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

ICE with complex array assignment with 2024.2

NCarlson
New Contributor I
611 Views

This little program triggers an internal compiler error on line 3:

complex :: x(5)
x = 1.0
x%im = -x%re
end

  

3 Replies
Devorah_H_Intel
Moderator
525 Views

Thank you for reporting the ICE to us. I have escalated it to our compiler engineering for a fix and will post an update when the fix becomes available. 

0 Kudos
Devorah_H_Intel
Moderator
211 Views

This issue was fixed in 2025.1 ifx. 

0 Kudos
JohnNichols
Valued Contributor III
176 Views
    !  Console2.f90
    !
    !  FUNCTIONS:
    !  Console2 - Entry point of console application.
    !

    !****************************************************************************
    !
    !  PROGRAM: Console2
    !
    !  PURPOSE:  Entry point for the console application.
    !
    !****************************************************************************

    program Console2

    implicit none
    complex :: xy(5)
    REAL :: t1,t2,rate
    INTEGER :: c1,c2,cr,cm,i,j,n,s,j1,i1
    INTEGER , PARAMETER :: x=20000,y=15000,runs=1000
    REAL :: array(x,y),a_diff,diff

    ! First initialize the system_clock
    CALL system_clock(count_rate=cr)
    CALL system_clock(count_max=cm)
    rate = REAL(cr)
    WRITE(*,*) "system_clock rate ",rate

    diff = 0.0
    a_diff = 0.0
    s = 0
    CALL CPU_TIME(t1)
    CALL SYSTEM_CLOCK(c1)
    do 200 j1 = 1,runs
    write(*,*)j1
        do 100 i1 = 1, 1000000
            xy = 1.0
            xy%im = -xy%re
100 end do
200 end do

    CALL CPU_TIME(t2)
    CALL SYSTEM_CLOCK(c2)
    array(1,1) = array(1,2)
    IF ( (c2 - c1)/rate < (t2-t1) ) s = s + 1
    diff = (c2 - c1)/rate - (t2-t1) + diff
    a_diff = ABS((c2 - c1)/rate - (t2-t1)) + a_diff

    WRITE(*,*) "system_clock : ",(c2 - c1)/rate
    WRITE(*,*) "cpu_time     : ",(t2-t1)
    WRITE(*,*) "sc < ct      : ",s,"of",runs
    WRITE(*,*) "mean diff    : ",diff/runs
    WRITE(*,*) "abs mean diff: ",a_diff/runs
    end

 

if we put the simple program into a timing program, the result is 

12 seconds against 3.7 if we use

 

xy = (1.0, -1)

Screenshot 2025-04-02 174238.png

If you are monitoring critical infrastructure then the difference between 3 and 12 can be a real problem. 

 

0 Kudos
Reply