for <==> while (an exception)

Walter Bright bright at dataio.UUCP
Wed Jul 17 20:03:40 AEST 1985


Some optimizing compilers generate different code for while and for loops.
The for loop makes it easy for the compiler to figure out what the
loop initialization, continuation and next expressions are. This makes
it easier to do things like loop rotation and converting loops to
do-while loops. An example of a compiler that generates better code
for for loops is the Greenhills C compiler.



More information about the Comp.lang.c mailing list