Liste des Groupes | Revenir à c arch |
Thomas Koenig wrote:This is probably my asm background shining trough:
Terje Mathisen <terje.mathisen@tmsw.no> schrieb:This is partly due to programming languages that applies lifetimes to variables, so that an index register which is defined in the
scaffolding
>
of the loop (i.e. for (i = 0; i < limit; i++) {}) is invisible as soon as the loop terminates.This makes things more clear to anybody reading the code (andWhen one writes::
unambiguous to the compiler). However, lifetime analysis has
also become very good, and if the value is not used afterwards,
I expect no difference in practice.
for( uint64_t i = 0; i < max; i++ )
the lifetime of i is explicit--it terminates with the loop.
Without such a restriction, there are many times when it would be very natural to inspect the index in order to determine if this was a normal
>
(counting) exit, or an early exit due to some internal test.Hmm... do you mean for the programmer, or for the compiler?
Les messages affichés proviennent d'usenet.