Unwanted compiler optimization (was: Bug report and fix for adaptive step size control in ODE solving)

Jochen Küpper jochen@fhi-berlin.mpg.de
Thu Jan 3 09:01:00 GMT 2008


Dear Optimization specialists,

On 02.01.2008, at 19:46, Frank Reininghaus wrote:

> Jochen Küpper wrote:
>
>> However, why don't you test what you really describe your comment?  
>> This would look like the following (untested):
>>
>>  h0 = GSL_MAX_DBL(GSL_DBL_MIN, (t0 != t0+h0) ? h0 :  
>> GSL_DBL_EPSILON*t0);
>
> Actually, I had been thinking of something like that first, but then  
> I was afraid that an optimising compiler might transform 't0 !=  
> t0+h0' into '0 != h0', making the patch useless for the 'h0 <  
> GSL_DBL_EPSILON*t0' problem.


Is this an optimization that is considered valid even for floating- 
point calculations in compiler building?

Maybe we should ask our friends from the GCC development about it...

Greetings,
Jochen
-- 
Einigkeit und Recht und Freiheit                http://www.Jochen-Kuepper.de
     Liberté, Égalité, Fraternité                GnuPG key: CC1B0B4D
         Sex, drugs and rock-n-roll


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://sourceware.org/pipermail/gsl-discuss/attachments/20080103/e943394f/attachment.sig>


More information about the Gsl-discuss mailing list