[tree-ssa] Dce & infinite loops

Dave Korn dk@artimi.com
Thu Mar 18 17:30:00 GMT 2004


> -----Original Message-----
> From: gcc-owner On Behalf Of Zdenek Dvorak
> Sent: 18 March 2004 17:00

> > For me, the most important thing is consistency.  Right now 
> we do not 
> > remove infinite loops that are infinite because they have no loop 
> > exit, but we do kill infinite loops that are infinite 
> because the exit 
> > condition can never be true.  We should either remove all infinite 
> > loops, or none at all.
> 
> sorry, this is not up to us -- we must preserve *all* 
> infinite loops to be correct.  Only if we are able to prove 
> the loop must always terminate we may remove it.
> 
> Zdenek

  This discussion is becoming confused, owing to a lack of clarity in
people's posts: we must all take more care to be clear about the distinction
between finite and _in_finite loops.

  Removing an empty loop BODY (but keeping the actual loop) is always valid.

  Removing the body of a FINITE loop and just emitting code to perform the
side-effects is also always valid.

  Removing an INFINITE loop is NEVER valid, regardless of the content of its
body, because the program flow should never get past an INfinite loop.

    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....



More information about the Gcc mailing list