Consider following 3 address code
t1 = t+e
t2 = g+a
t3 = t1*t2
t4 = t2+t2
t5 = t4+t3
The minimum number of temporary variables that can be used in equivalent 3-address code of above code is
Approach:
t = t+e, g = g+a, t = t*g, g = g+g,t = t+g. Hence 4 temporary variables are needed. Is this right?