Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
1 View

Issue with optimized compilation with ifort?

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
Highlighted
Moderator
1 View

Do you have the same results

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

Devorah - Intel® Developer Support
0 Kudos
Highlighted
Valued Contributor I
1 View

Indeed, the issue is there

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

0 Kudos
Highlighted
1 View

Thank you for prompt answers

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

0 Kudos