News for hackers. Stuff that matters.
Re:Do C compilers disprove Fermat's Last Theorem? by Rexxar on Saturday May 01, 2010 @10:14AM (#1310578)
Every optimization can potentially have a side-effect :

    {
        time ta0 = getTime();
        for (;;) { /* do something 1*/ }
        time ta1 = getTime();
        
        time tb0 = getTime();
        for (;;) { /* do something 2*/ }
        time tb1 = getTime();
        
        if(ta1-ta0 < tb1-tb0)
            destroy_the_world(); /* has side-effects */
    }
The result depends of the speed of execution of each loops. Should optimizations really be allowed only if they don't have any side effect ?

There are no comments on this comment yet.