Is there any way to work out a priori whether or not two variables alias the same memory? (I assume that aliasing pertains to memory overlap within widths the maximum size of memory addressable by the CPU in one instruction.)
However, the general analysis you are looking for is known as "points-to analysis".
It is a very large and complicated topic. Happy to try to answer anything more specific though.