Message-ID: <321AFEA6.6A16@pobox.oleane.com> Date: Wed, 21 Aug 1996 14:18:46 +0200 From: Francois Charton Organization: CCMSA MIME-Version: 1.0 To: Randall Defauw CC: djgpp AT delorie DOT com Subject: Re: Optimization flag References: <321A20FB DOT 41C67EA6 AT umich DOT edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Randall Defauw wrote: > > Hello, > I am trying to use the -O1 or -O2 optimization flag on djgpp v2.0. > When I use these flags, my program crashes with a floating point > exception error. When I skip the optimization flags, the program works > fine. Since one version of the program works, I haven't been able to > trace down why the optimized version crashes. Does anybody have any > suggestions regarding the optimization flag? > If anybody responds to this, I'd appreciate it if you would cc the > message to rrdefauw AT umich DOT edu. Thanks! > There is a bug in libm.a, which probably cause your exceptions. A very simple solution to this is to remove the -lm flag from your linker options. Math functions will still be linked because they are in libc.a (but the ones in libc have no bug, and are faster...). The only case where this workaround won't work is if you use gamma or Bessel functions, then you need libm.a. A patched version ca be found at ftp://ftp.lstm.ruhr-uni-bochum.de/pub/djgpp Regards Francois