'bug' with Intel FORTRAN for Linux

From: glockner (glockner_at_enscpb.fr)
Date: 03/30/05


Date: 30 Mar 2005 00:02:52 -0800

Hello,
I have a problem with Intel FORTRAN compiler (8.1.25) when the program
is optimized or not. It works well on anothers compilers (COMPAQ
VISUAL FORTRAN on Windows, SGI f90, HP-UX f90, ifort on IA64, f90 on
True64, g77 cygwin, g77 and g95).

The program is very simple.
If you put in a variable named V1 1.D0, in V2 again 1.D0, and you make
the operation V1-V2+1.D-20, you find 2 different results whatever you
optimize or not :

V1-V2+1.D-20 = 9.999999999999999E-021 (correct ; -O0)
V1-V2+1.D-20 = 0.000000000000000E+000 (optimized)

If you replace 1.D-20 by 1.D-14 :

V1-V2+1.D-14 = 1.000000000000000E-014 (correct ; -O0)
V1-V2+1.D-14 = 9.992007221626409E-015 (optimized)

It seems that V2+1.D-20 is the first operation made when optimized.
The behavior is strange compared with other compiler. Moreover, if you
put 1.D-20 in a variable named V3, it works well. So the way Intel
handle variable or numerical values such as 1.D-20 is different.

In the original program (more complex), the operation V1-V2+1.D-20 is
at the denominator of a division and produces NaN.

Here is a program test :

 program test
 double precision V1,V2,V3,V4

 V1=1.D0
 V2=1.D0
 V3=1.D-20
 V4=1.D0/(V1-V2+1.D-20)
 print*,V4
 V4=1.D0/(V1-V2+V3)
 print*,V4
 end

Working with numbers close to computer precision is dangerous but I
think that a compiler should not have such a problem (it is the only
one among the 9 compiler tested to produce such a result).
Any comments ?
Thanks
S. Glockner



Relevant Pages

  • Re: bug with Intel FORTRAN for Linux
    ... I have submited the case to the Intel support. ... If anybody have another compiler than the one cited, ... > Here is a program test: ... > Working with numbers close to computer precision is dangerous but I ...
    (comp.lang.fortran)
  • Re: *** glibc detected *** problem
    ... > I've compiled a meteorological model using Intel Fortran Compiler ... It means that there was some kind of memory corruption, ... end of malloced buffer, double free, freeing something ...
    (Fedora)
  • Re: Bus error/ segmentation fault--help?
    ... When I compile with the intel fortran compiler, ... This subroutine integrates the function y3 up one step, ... implicit double precision (a-h, o-z) ...
    (comp.lang.fortran)
  • Re: gfortran binaries from 64 to 32 bit
    ... gemini), compiled with intel fortran compiler. ... have compiled using gfortran. ...
    (comp.lang.fortran)
  • Re: gfortran binaries from 64 to 32 bit
    ... gemini), compiled with intel fortran compiler. ... have compiled using gfortran. ...
    (comp.lang.fortran)