home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / aix / 8749 < prev    next >
Encoding:
Text File  |  1992-08-12  |  1.1 KB  |  29 lines

  1. Newsgroups: comp.unix.aix
  2. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!yale!gumby!destroyer!ncar!noao!noao.edu!tody
  3. From: tody@noao.edu (Doug Tody)
  4. Subject: catching integer divide by zero in C code
  5. Message-ID: <1992Aug12.194918.21644@noao.edu>
  6. Sender: news@noao.edu
  7. Nntp-Posting-Host: lepus.tuc.noao.edu
  8. Reply-To: tody@noao.edu
  9. Organization: National Optical Astronomy Observatories
  10. Date: Wed, 12 Aug 1992 19:49:18 GMT
  11. Lines: 16
  12.  
  13. If I look at the assembler generated for an integer divide statement by the
  14. AIX Fortran compiler I see the following:
  15.  
  16.     teqi   r0,0x0
  17.     divs   r0,r4,r0
  18.  
  19. In C code however, the teqi instruction is missing.  This is the instruction
  20. that checks for an integer divide by zero and traps if one is seen.
  21.  
  22. Looking through the documentation for the C compiler I don't see any way to
  23. generate the integer divide by zero check (-qflttrap is similar but is only
  24. for floating point).  Am I missing something?  Is there any way to do this?
  25.  
  26. -- 
  27. Doug Tody    National Optical Astronomy Observatories
  28. tody@noao.edu   P.O. Box 26732, Tucson, Arizona, 85726
  29.