home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.aix
- Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!yale!gumby!destroyer!ncar!noao!noao.edu!tody
- From: tody@noao.edu (Doug Tody)
- Subject: catching integer divide by zero in C code
- Message-ID: <1992Aug12.194918.21644@noao.edu>
- Sender: news@noao.edu
- Nntp-Posting-Host: lepus.tuc.noao.edu
- Reply-To: tody@noao.edu
- Organization: National Optical Astronomy Observatories
- Date: Wed, 12 Aug 1992 19:49:18 GMT
- Lines: 16
-
- If I look at the assembler generated for an integer divide statement by the
- AIX Fortran compiler I see the following:
-
- teqi r0,0x0
- divs r0,r4,r0
-
- In C code however, the teqi instruction is missing. This is the instruction
- that checks for an integer divide by zero and traps if one is seen.
-
- Looking through the documentation for the C compiler I don't see any way to
- generate the integer divide by zero check (-qflttrap is similar but is only
- for floating point). Am I missing something? Is there any way to do this?
-
- --
- Doug Tody National Optical Astronomy Observatories
- tody@noao.edu P.O. Box 26732, Tucson, Arizona, 85726
-