News for hackers. Stuff that matters.
Re:Do C compilers disprove Fermat's Last Theorem? by barrkel on Saturday May 01, 2010 @02:29AM (#1310217)
If you accept the grandparent's argument on face value, you should accept that a compiler should be able to remove other do-nothing infinite loops, like in the example I mentioned elsewhere:

    for (;;)
        /* do nothing */;
    destroy_the_world(); /* has side-effects */
Why should a compiler remove the loop in the OP's case, but not remove the loop above? Do you accept that removing the loop changes the side-effects of the program?
Re:Do C compilers disprove Fermat's Last Theorem? by gojomo on Saturday May 01, 2010 @04:51AM (#1310322)
It does change the effects -- but in a predictable and possibly-useful way. A loop that doesn't exit or do any work itself is far more likely a bug than an intentional behavior; removing it like other do-nothing code may benefit far more programs seeking "optimization" than the alternative.