Performance impact of how a large array is accessed

This a problem, as the compiler has to provide instructions at compile time.

Typically in this case, this would lead to providing a temporary copy, as I am not aware of compilers providing both options, then choosing at run time.
( I have asked for a similar approach with stack overflow, where at run time, if the array does not fit on the stack, it is sent to the heap. Imaging how much easier this would be for the user ! After all it is just a new memory address + a bit of clean up)

I expect if the need for a temporary array is not clear, then a temporary array would be provided (unless a non-contiguous array can be handled by the called routine)