This is the mail archive of the
mailing list for the GNU Fortran project.
Strange SIGFPE (underflow?) with gfortran
- From: Rob <spamrefuse at yahoo dot com>
- To: fortran at gcc dot gnu dot org
- Date: Thu, 19 Oct 2006 22:23:33 -0700 (PDT)
- Subject: Strange SIGFPE (underflow?) with gfortran
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=5M6eiEIrH2Qnb8+CO37bnU+0bXsGkCud/ylfy5b9W0v/ZgbIKvIkbVsNIg9IxUOQNcFuCMMWRsW+aofbS++KkzYvKIh0zcSOH5IkXZZA+FAXNSkdpAaDW/JgMiuMB/C9/YjtEmiv+FXifx1IESsxYSpxBEZC8Qwf7u3Ov2KjI7o= ;
I'm using GCC 4.1.2, from SVN as of about two weeks
ago. It's on an AlphaServer system with Linux
I have this piece of Fortran code:
Compiling with gfortran is OK. However, when running
the executable, I get an SIGFPE Arithmetic exception
at the line with the R3 assignment. Using gdb, I get
R1 = -708.39697265625
R2 = 2.2238412332569656e-308
R3 = 0
The value of R3 should be 1, as R2 is close to zero.
I suppose the FPE is an underflow exception, but
why is the underflow not squashed to zero?
However, when I change the first line to
(change last digit from 7 to 6) then the SIGFPE
disappears when running the executable. In that
case I have (using gdb):
R1 = -708.39599609375
R2 = 2.2260140139667223e-308
R3 = 1
Is this a problem with the gfortran compiler?
Is there a flag I can pass during compilation
and/or linking, to avoid such problems?
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around