From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,c7939ddb77286dd6,start X-Google-Attributes: gid111c93,public X-Google-Thread: 1094ba,ec9df96737a7864b X-Google-Attributes: gid1094ba,public From: "G. Hugh SONG" Subject: __setfpucw(0x1372); (was Re: Alpha design flaw?) Date: 1998/10/23 Message-ID: <70ovd0$d65$1@news.kjist.ac.kr>#1/1 X-Deja-AN: 404163734 Content-Transfer-Encoding: 7bit References: <362F70E2.3031@ipa.net> <70nup5$16h8$1@nntp6.u.washington.edu> <70o2bv$maf$1@newnews.nl.uu.net> Content-Type: text/plain; charset=us-ascii Organization: KJIST, KwangJu, KOREA Mime-Version: 1.0 Newsgroups: comp.lang.fortran,comp.os.linux.alpha Toon Moene wrote: > kargl@troutmask.apl.washington.edu (Steven G. Kargl) wrote: > > > In article <362F70E2.3031@ipa.net>, > > "Donald L. Baker" writes: > > > > Not only does DEC Visual Fortran for Alpha > > > pag:kargl[258] cat a.f > > real x,y,z > > x = 1.e0 > > y = 0.9999999999e0 > > z = 1.e0 / (x - y) > > print *, z > > end > > pag:kargl[259] f77 -fpe -o a -g2 a.f -lm > > pag:kargl[260] dbx a > > dbx version 3.11.8 > > Type 'help' for help. > > > a$main: 1 real x,y,z > > (dbx) run > > signal Floating point exception at [a$main:5 +0x4,0x120001894] print *, z > > > Perhaps, it isn't Digital's problem. Pilot error? > > Close. Note that Donald is talking about Digital *Visual* Fortran. Bet it > runs on a Microsoft OS. > > From an earlier message: > > > Not only that, this kind of error now appears not in an > > obvious window, or a jump to ntdll.dll assembly language, > > but in the in the bottom window of DevStudio. It's as > > if DEC thinks they can solve the problem by moving it to > > the fine print. It's the same kind of approach that Bill > > Clinton takes to defining sex. It may be lawyerly, but > > it's not reliable fortran. > > g77 has more or less the same problem, although the real *source* of the > problem is different: We have to support a couple of Free Unices (at the > very least: NetBSD, Linux), Microsoft Windows NT, Digital Unix (and perhaps > even OpenVMS, but not sure about that) - it's pretty much impossible to get > all the `set the floating point exception mask to "trap on divide by zero"' > right on every single OS mentioned above. > > -- > Toon Moene (mailto:toon@moene.indiv.nluug.nl) > Saturnushof 14, 3738 XG Maartensdijk, The Netherlands > Phone: +31 346 214290; Fax: +31 346 214286 > g77 Support: mailto:fortran@gnu.org; egcs: mailto:egcs-bugs@cygnus.com With g77 on i386 Linux, the following C routine called in the first line of a fortran program call FPUSETDEF handles fpu error. #include void fpusetdef_(void) { __setfpucw(0x1372); } Isn't there any equivalent number instead of 0x1372 for g77 on Alpha/Linux? -- G. Hugh Song PS: Please remove "Spamspoiler" when replying for spam extractors, FCC Commisioners' email addresses are: wkennard@fcc.gov,sness@fcc.gov,pmisener@fcc.gov,mpowell@fcc.gov