??? 06/30/05 15:49 Read: times |
#96315 - asking too much Responding to: ???'s previous message |
Why doesn't the optimiser invert this?
unsigned char a; unsigned char b; for(a=0;a<10;a++) { b++; } That's asking too much. In your simple example, yes it could, but for a global implemetation, it would have to analyze the entire for loop (some I have seen have had hundereds of lines) to see if a little thing like ralph[a] or so was hidden somewhere in the loop. In your example it would be bad coding to even have b since a could be used instead. Anyhow, if the optimizer et al were "perfect" the advantage of most knowledge would disappear and the guru would be no better than the tyro. Erik |