www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/21/09:05:24

Message-ID: <321AFEA6.6A16@pobox.oleane.com>
Date: Wed, 21 Aug 1996 14:18:46 +0200
From: Francois Charton <deef AT pobox DOT oleane DOT com>
Organization: CCMSA
MIME-Version: 1.0
To: Randall Defauw <rrdefauw AT umich DOT edu>
CC: djgpp AT delorie DOT com
Subject: Re: Optimization flag
References: <321A20FB DOT 41C67EA6 AT umich DOT edu>

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019