Turns out it is perfectly valid for a C++ compiler to emit different machine code when recompiling the same program with exactly the same compiler/environment/whatever settings. Which implies that the compiler optimizer can decide how "deep" to optimize depending on various factors, amount of available memory included.
Does anyone have any evidence of whether Visual C++ does perform different optimizations depending on amount of memory available?