Mail Archives: djgpp/1996/08/21/09:05:24
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
- Raw text -