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

possible bug in complex log function, single precision, 32 bits

prunet
Beginner
445 Views
I traced a segfault to the clogf function, when compiling in 32 bits:

[prunet@horizon8 ~/essai]$ cat check_clogf.f90
program check_clogf

real(kind=4) :: a,b

a=0
b=1

print*,log(cmplx(a,b))

end program check_clogf

[prunet@horizon8 ~/essai]$ source /usr/local/intel/Compiler/bin/ifortvars.csh ia32
[prunet@horizon8 ~/essai]$ which ifort
/usr/local/intel/Compiler/composerxe-2011.3.174/bin/ia32/ifort
[prunet@horizon8 ~/essai]$ ifort -o check_clogf check_clogf.f90
[prunet@horizon8 ~/essai]$ ./check_clogf
Segmentation fault

however, when compiling in 64 bits, there is no problem:

[prunet@horizon8 ~/essai]$ source /usr/local/intel/Compiler/bin/ifortvars.csh intel64
[prunet@horizon8 ~/essai]$ which ifort
/usr/local/intel/Compiler/composerxe-2011.3.174/bin/intel64/ifort

[prunet@horizon8 ~/essai]$ ifort -o check_clogf check_clogf.f90
[prunet@horizon8 ~/essai]$ ./check_clogf
(0.0000000E+00,1.570796)

I checked that the double precision (clogd) function does not have this problem.

I wonder if this is a known bug ?

Cheers,
Simon


0 Kudos
2 Replies
mecej4
Honored Contributor III
445 Views
I cannot reproduce the bug with your code using IFort 12.0.3-32bit on Suse X64.
0 Kudos
Ron_Green
Moderator
445 Views
did you read this article? It has suggestions for diagnosing seg violations:

http://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors/
0 Kudos
Reply