"Storing an element's value in a temporary variable may prevent the compiler from optimizing references to MajorArrayElementPtr and its elements ..."
That's precisely the contrary of what I want to achieve. I want to know ways of optimizing it the mostly possible, not cripple the compiler's own optimization.
Basically I just though using a 3rd pointer was the best method to use to avoid using double indirection when a pointer is in some place pointed to by another pointer. I suppose some compilers optimize it when they see the number of accesses justify it but we don't have any control over it do we?
And if I use a 3rd pointer I'm actually making use of unecessary mem space, so more stack pushes and pulls and/or more address registers used.
I think I'm gonna let the compilers memory management handle it instead of writing obfuscated code. Someone must have already though about this.