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

IFX 2025.1.1, optimizer bug

J_Kuthe
Novice
1,630 Views

A customer reported a bug with the IFX release  2025.1.1 under Windows. I checked this and can confirm that the optimizer (option /O2 - "Maximize Speed") fails with IFX release  2025.1.1, and with the previous release too.

After building the following simple FORTRAN 77 program (PTEST.FOR, attached)

IMPLICIT REAL*8(A-H,O-Z)
DIMENSION CNST(178),CNST1(178)
OPEN(UNIT=10,FILE='P1.TXT')
OPEN(UNIT=30,FILE='PTEST.TXT')
NP=178
DO 100 I=1,NP
   READ(10,*) X,X,CNST(I),X,X
   CNST1(I)=CNST(I)
   WRITE(30,637) I,CNST(I),CNST1(I)
100 CONTINUE
637 FORMAT(I4,4F8.3)
STOP
END

and running the .exe which reads in a file P1.txt (attached), the output written to PTEST.TXT is faulty. The first 5 lines written by the WRITE(30,637)... command are:

1 10.811 0.000
2 10.799 0.000
3 11.302 0.000
4 11.197 0.000
5 11.131 0.000

instead of

1 10.811 10.811
2 10.799 10.799
3 11.302 11.302
4 11.197 11.197
5 11.131 11.131

The correct result is obtained when the optimizer is turned off (/Od)

I have tested in VS2022.

Jörg Kuthe

I am working for Intel Resellers QT software GmbH, Germany, and Polyhedron Software & Services Ltd, United Kingdom.

 

0 Kudos
1 Solution
Devorah_H_Intel
Moderator
1,168 Views
0 Kudos
5 Replies
garraleta_fortran
1,567 Views

Yes is a BIG BUG

0 Kudos
garraleta_fortran
1,552 Views

This run OK

IMPLICIT REAL*8(A-H,O-Z)
DIMENSION CNST(178),CNST1(178)
OPEN(UNIT=10,FILE='P1.TXT')
OPEN(UNIT=30,FILE='PTEST.TXT')
NP=178
DO 100 I=1,NP
    READ(10,*) X,X,CNST(I),X,X
   CNST1(I)=CNST(I)
   XX=CNST1(I)
   WRITE(30,637) I,CNST(I),CNST1(I),XX
100 CONTINUE
637 FORMAT(I4,4F8.3)
STOP
END

0 Kudos
Shiquan_Su
Moderator
1,413 Views

We brought the engineer's attention to this issue. Thanks for reporting this.


0 Kudos
Devorah_H_Intel
Moderator
1,169 Views

@MarcGrodent The fix for this particular issue will be in the future 2025.3 ifx release. 


@MarcGrodent wrote:

I think this is exactly the same issue as reported here:

https://community.intel.com/t5/Intel-Fortran-Compiler/Incorrect-results-using-O2-or-O3-in-ifx-Minimal-example-attached/m-p/1684806#M175558 


 

0 Kudos
Reply