Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Integer overflow, ifort internal compiler error

$
0
0

I am just playing with integer overflow in fortran compilers and have found that this simple "buggy" fortran code causes internal compiler error by ifort on each of the write instruction. Gfortran detects these overflows and shows some "Error: Arithmetic overflow" during compilation.

program    integer_overflow
implicit none
    write(*,*) -(-2147483647-1)
    write(*,*) 2000000000 + 2000000000
    write(*,*) -2147483647 - 2147483647
    write(*,*) 46341 * 46341
    write(*,*) (-2147483647-1) / -1
end program integer_overflow

With ifort (IFORT) 15.0.2 20150121

ifort intel_bug.f90 -o intel_bug.x
intel_bug.f90: catastrophic error: **Internal compiler error: floating point exception signal raised**

 


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>