Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26731 Discussions

Issue with optimized compilation with ifort?

christensen__asbjorn
83 Views

Dear expert,

I've been staring on this issue all day, and believe the compiler has an bug when compiling with flags "-O3 -fast". I've tried to distil the code into the simplest case displaying the issue. Compiling as

   ifort  -O3 -fast  numeric_aux.f90 test.f90

gives faulty code (stdout below) whereas

   ifort   numeric_aux.f90 test.f90

produces code giving the intended output. The former (faulty code) produces the output:


 x0    =   2.00000000000000     
 x1    =   8.00000000000000     
 x     =   2.12246204830937        2.51984209978975        2.82842712474619     
   3.17480210393640        3.56359487256136        4.00000000000000     
   4.48984819323749        5.03968419957949        5.65685424949238     
   6.34960420787280        7.12718974512271        8.00000000000000     
 walls =   2.00000000000000        2.24492409661875        2.51984209978975     
   2.82842712474619        3.17480210393640        3.56359487256136     
   4.00000000000000        4.48984819323749        5.03968419957949     
   5.65685424949238        6.34960420787280        7.12718974512271     
   8.00000000000000     
 dx    =  0.244924096618746       0.000000000000000E+000  0.000000000000000E+000
  0.000000000000000E+000  0.000000000000000E+000  0.000000000000000E+000
  0.000000000000000E+000  0.000000000000000E+000  0.000000000000000E+000
  0.000000000000000E+000  0.000000000000000E+000  0.000000000000000E+000


i.e. the output array dx is not set. The pattern is fragile, i.e. it (may) disappear if I change array dimension n or for instance uncomments the write statement in subroutine setup_exponential_grid. I use the following configuration

ifort version 17.0.2
OS       == Ubuntu 16.04.5 LTS
Hardware == HP ZBook 15G3

I've removed the stack limit with "ulimit -s unlimited", as I previously had problems with automatic fortran variables

0 Kudos
3 Replies
Devorah_H_Intel
Moderator
83 Views

Do you have the same results with 19.0.2 compiler? I do not see it with 19.0.2.

Juergen_R_R
Valued Contributor I
83 Views

Indeed, the issue is there with 17.0.8, but neither 18.0.5 nor 19.0.2.

christensen__asbjorn
83 Views

Thank you for prompt answers - it seems like time to upgrade my ifort compiler.

Reply