What do you mean? Calculating the address of x[4] or calculating address of x[0] and index with 4 * sizeof(int) are really equivalent in the computers mind.
There are of course differences in some processor architectures which may make one or the other more efficient, but as long as the compiler can sort out that the code isn't going to be affected by "changing from one form to the other", it can do so.
Unless you specifically KNOW that the compiler generates particularly bad code for some PARTICULAR code, you can assume that any array references that can be easier/better solved with a temporary pointer variable, the compiler will use a temporary pointer.
However, if you start adding extra variables for the reason that you think the compiler won't solve the problem, you may find that the compiler generates WORSE code.
_IF_ you play around with code in this way, make sure:
1. That you retain the original code for future versions of the compiler, where it does compile it properly.
2. Verify that your code actually DOES run faster - and that the difference is noticable - reducing the prologue of a for-loop by one cycle in a loop that runs 2000 times isn't worth it.
3. Make CLEAR comments on why you do this.
4. Keep track of whether the next version of compiler actually does it equally well.
5. Make sure you are optimizing code that matters.
--
Mats