Xref: utzoo comp.unix.microport:546 comp.bugs.sys5:435 Path: utzoo!mnetor!uunet!husc6!mailrus!umix!b-tech!zeeff From: zeeff@b-tech.UUCP (Jon Zeeff) Newsgroups: comp.unix.microport,comp.bugs.sys5 Subject: Re: 386/ix bug on doubles inside if-statement ? Message-ID: <4443@b-tech.UUCP> Date: 27 Apr 88 21:58:38 GMT References: <672@altger.UUCP> Reply-To: zeeff@b-tech.UUCP (Jon Zeeff) Organization: Branch Technology Ann Arbor, MI Lines: 25 In article <672@altger.UUCP> dirk@altger.UUCP (dirk) writes: >Does anyboady have an idea why the following program fails ? > > if (fabs (a) < fabs (b)) printf("a is lower\n"); Evidently most of the Sys V '386 compilers produce incorrect code for this. Often you get: fldl -40(%ebp) fcompp When you should get: fcompl -40(%ebp) Perhaps the bug is consistent enough that the first form can always be replaced by the second form by some add on program. Does anyone have gcc working well enough that I can throw out this buggy compiler? -- Jon Zeeff Branch Technology, uunet!umix!b-tech!zeeff zeeff%b-tech.uucp@umix.cc.umich.edu