Re: Trap Overflow - Intel Compilers



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.)

.



Relevant Pages

  • Re: Proper Error Handling of SQL Connection opening
    ... I've read (and I'm a .NET book junkie) has to be Jeffrey Richter's Applied ... Exception handling is and how to employ it. ... Don't trap exceptions just to trap them. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: [PATCH 1/4] kgdb: support for ARCH=arm
    ... +void kgdb_arch_exit ... * placed into R14_svc before jumping to the vector trap. ... * gdb is expecting the following registers layout. ...
    (Linux-Kernel)
  • Re: double panic, and whats apic_cmd? (kqemu crash...)
    ... I also have KDB_TRACE and KDB_UNATTENDED in the kernel config. ... GDB is free software, covered by the GNU General Public License, and you are ... Fatal trap 12: page fault while in kernel mode ...
    (freebsd-hackers)
  • RE: RELENG_5 panic
    ... kernel trap 12 with interrupts disabled ... Fatal trap 12: page fault while in kernel mode ... GDB is free software, covered by the GNU General Public License, and you are ...
    (freebsd-stable)
  • Re: double panic, and whats apic_cmd? (kqemu crash...)
    ... I also have KDB_TRACE and KDB_UNATTENDED in the kernel config. ... GDB is free software, covered by the GNU General Public License, and you are ... Fatal trap 12: page fault while in kernel mode ...
    (freebsd-hackers)

Loading