[BUG][!] Optimization bug in gcc! [was: Re: sinful bug]

Stephan Rudlof sr at evolgo.de
Fri Aug 4 02:59:19 UTC 2000


Stephan Rudlof wrote:
> 
> Stephan Rudlof wrote:
> >
> > Dear Squeakers,
> >
> > there seems to be an optimization bug in gcc, arising in interp.c for -O1
> > already!
> >
> > Example: Optimization for sin()'s is possible; program
> >
> > #include <stdio.h>
> > #include <math.h>
> >
> > static void testDoubles () {
> >   printf("\n_LIB_VERSION == _POSIX_: %d", _LIB_VERSION == _POSIX_);
> >   { double arg1 = 1.0e20;
> >   printf("\nsin(arg1): %e", sin(arg1));
> >   }
> >   _LIB_VERSION = _IEEE_;
> >   printf("\n_LIB_VERSION == _IEEE_: %d", _LIB_VERSION == _IEEE_);
> >   {
> >     double arg2 = 1.0e20;
> >     printf("\nsin(arg2): %e", sin(arg2));
> >   }
> > }
> >
> > int main () {
> >   testDoubles();
> > }
> >


> > works correctly with -O3. 

No, it doesn't work correctly; see 'Correction: ...' mail.

Stephan
-- 
Stephan Rudlof (sr at evolgo.de)
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3





More information about the Squeak-dev mailing list