[patch] Empty loop removal

Zdenek Dvorak rakdver@atrey.karlin.mff.cuni.cz
Thu Jun 30 23:04:00 GMT 2005


Hello,

> >+   for (i = 0; i != n; i += 2)
> >+     ;
> 
> Can't we just convert this loop to:
> if ((n%2) != 0)
>   while (true) ;
> 
> Or do we need to know more information?

yes, we can.  But I don't see any practical gain in implementing
this optimization.

Zdenek



More information about the Gcc-patches mailing list