|
|
Willem wrote:
> Ioannis wrote:
> ) Yes, if "register" is taken under consideration by the compiler,
> ) obviously there will be one register less for the rest of the program,
> ) and yes it can affect the run-time execution of another part of the
> ) program (as long as the register variable remains in scope *and* at the
> ) same time multiple-variables needing to be stored in registers are used
> ) concurrently) , but this falls in the "proper uses of register" I wrote
> ) above.
>
> Ah, so now you're claiming that if a use of 'register' makes the code
> run less efficiently, then it's not "proper use" ?
>
> Where I come from we call that a circular argument.
In general, "register" should be used in small scopes. Consider an
example I posted in another message in the thread:
"An example of proper use:
for(register int i= 0; i< INT_MAX; ++i)
array[i]*= i;
Here the scope of register variable i is in the for-loop. It can affect
other portions of the program usually only in multithreading applications".
|
|