Hard
Twelve live values on an eight-register target
Suppose the target has 8 allocatable general-purpose integer registers. All 12 parameters are live at the marked point and every one of them is used again afterward. What does the register allocator do?
main.cpp
long compute(long a, long b, long c, long d, long e, long f,
long g, long h, long i, long j, long k, long l) {
long sum = a + b + c + d + e + f + g + h + i + j + k + l;
// all 12 parameters plus 'sum' are simultaneously live here
return sum * (a - l) + b * (c - k) + d * (e - j) + f * (g - h) + i;
}14 of 44 in Compilers