From: Cees Wesseling Newsgroups: comp.os.msdos.djgpp Subject: Re: Optimize switch -O2 create FPU error Date: Tue, 17 Sep 1996 10:55:11 +0100 Organization: Utrecht University Lines: 23 Message-ID: <323E757F.73B58D0@frw.ruu.nl> References: <323D96D7 DOT 5DA0 AT lem DOT ch DOT unito DOT it> NNTP-Posting-Host: holycow.frw.ruu.nl Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Carlo Nervi wrote: > > my program works fine under djgpp v1.12, but exit with SIGFPE > exception under djgpp v2.00. Using fsdb something strange happen: > sometimes it exit with a Underflow exception, but sometime else > running under fsdb the program runs, but with wrong numeric results. > > Finally I was able to catch the problem: by using -O2 or -O3 > optimization switches the problem persist, whereas by using -O > the problem disappear totally. > Anybody had similar experience or it is due to a bug already solved > which a don't know? Yes, I did have the same problem, in a piece of code that has very long and complicated expression. My guess is that this version of gcc just flaws on the optimization. I simply wait for the next release. You might want to try some code re-arranging to solve the problem. -- Cees Wesseling | PO BOX 80.115 | Dept. of Physical Geography | 3508 TC Utrecht | phone: (+31) 30 2532768 Utrecht University | the Netherlands | fax: (+31) 30 2540604