Xref: utzoo comp.lang.fortran:5139 comp.unix.aix:4406 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!noose.ecn.purdue.edu!gn.ecn.purdue.edu!jgs From: jgs@gn.ecn.purdue.edu (jgs) Newsgroups: comp.lang.fortran,comp.unix.aix Subject: XLF IEEE Handler? Message-ID: <1991Apr9.225143.9909@gn.ecn.purdue.edu> Date: 9 Apr 91 22:51:43 GMT Sender: jgs@gn.ecn.purdue.edu (jgs) Distribution: usa Organization: Purdue University Engineering Computer Network Lines: 50 I'm just posting this for a friend so please direct e-mail to the address below uunet!idaho!othello!rhodesii Does anybody know if it is possible to make XLF FORTRAN on an IBM RS-6000 to trap on a NAN or NANQ (or any other floating point exception)? >From what I can glean in the documentation is that exception handling can be enabled with: include'fexcp.h' call signal(sigtrap,xl_trce) and an exception will be generated under the following conditions: a. subscript out of bounds (if you specify the CHECK option at compile time) b. substring out of bounds (if you specify the CHECK option at compile time) c. Fixed point division by zero. d. Flow of program control reaches a location for which a semantic error with severity level S was issued when the program was compiled. Unfortunately these are not any of the conditions I am interested in (And even if I was this is not particularly useful since it only produces a traceback through the offset number of the routine. You then have to map the offset to the source number by checking the offset on the source listing.). What I want is something like SUN's ieee_handler that will trap on the 5 floating point exceptions found in IEEE 754-1985: 1. invalid opertion 2. division by zero 3. overflow 4. underflow 5. inexact Have I missed something in the documentation or isn't this implemented on the RS-6000? Joel Rhodes 591 Park Ave. Suite 302 Idaho Falls ID. 83402 ph(208) 522-8443 uunet!idaho!othello!rhodesii