Re: Trap Overflow - Intel Compilers
- From: Herman D. Knoble <SkipKnobleLESS@xxxxxxxxxxxxxxx>
- Date: Fri, 08 Jul 2005 08:43:41 -0400
Greg: Thanks. Inbetween postings, one of your colleagues sent
your suggestion. And it worked just as you illustrate! -g and
gdb facilitated an excellent traceback too.
Also is it possible to trap an underflow also? ( a=tiny(a )
The current version of the program is:
program testover
! Compile using Intel I32 compiler or PathScale EKO 64-bit
! compiler with options:
! ifort overflow1.f90 -fltconsistency -traceback -fpe0
! or
! pathf90 -O0 -g -msse2 -TENV:simd_omask=OFF overflow1.f90
! then use gdb ./a.out
!
real :: a
a=huge(a)
call compute(a)
end program testover
subroutine compute(a)
real :: a,b
b=a**2
print*, "b=",b
end subroutine compute
Many thanks.
Skip
On 7 Jul 2005 13:25:17 -0700, lindahl@xxxxxxx (Greg Lindahl) wrote:
-|In article <lspqc1tp36bj86pr7hia25lkri9l10avob@xxxxxxx>,
-|Herman D. Knoble <SkipKnobleLESS at SPAMpsu dot edu> wrote:
-|
-|>3) PathScale considers it's compiler's inability to trap
-|>IEEE exceptons a bug. They offer a bypass by using a C
-|>subprogram which CAN trap IEEE exceptions.
-|
-|Skip,
-|
-|We goofed up in our reply, we have a command-line option when
-|compiling that will trap this exception, with the usual
-|proviso that you have to either use -O0 or put it in a separate
-|subroutine in order to avoid compile-time evaluation of a**2.
-|
-|$ pathf90 -g -O2 -msse2 -TENV:simd_omask=OFF testover.f90
-|$ ./a.out
-|Floating point exception
-|$ gdb ./a.out
-|[...]
-|(gdb) r
-|Starting program: /home/lindahl/a.out
-|
-|Program received signal SIGFPE, Arithmetic exception.
-|0x080489c2 in foo (a=3.40282347e+38, b=3.98857539e-34) at testover.f90:11
-|11 b=a**2
-|Current language: auto; currently fortran
-|
-|-- greg
-|(working for, not speaking for, PathScale.)
.
- Follow-Ups:
- Re: Trap Overflow - Intel Compilers
- From: Greg Lindahl
- Re: Trap Overflow - Intel Compilers
- References:
- Trap Overflow - Intel Compilers
- From: Herman D . Knoble
- Re: Trap Overflow - Intel Compilers
- From: Herman D . Knoble
- Re: Trap Overflow - Intel Compilers
- From: Glyn Edwards
- Re: Trap Overflow - Intel Compilers
- From: Herman D . Knoble
- Re: Trap Overflow - Intel Compilers
- From: Greg Lindahl
- Trap Overflow - Intel Compilers
- Prev by Date: Re: Optimization in gfortran
- Next by Date: Re: Call Fortran DLL from delphi
- Previous by thread: Re: Trap Overflow - Intel Compilers
- Next by thread: Re: Trap Overflow - Intel Compilers
- Index(es):
Relevant Pages
|
Loading