Problem: The compiler has a bug inside and it is not working. You have to its job to associate program variables with registers:
Solution:
f = (g + h) - (i + j)
add $t0, $s1, $s2 #gets g + h
add $t1 ,$s3, $s4 #gets i + j
sub $s0, $t0 , $t1 # gets (g + h) - (i +j)
Solution:
f = (g + h) - (i + j)
add $t0, $s1, $s2 #gets g + h
add $t1 ,$s3, $s4 #gets i + j
sub $s0, $t0 , $t1 # gets (g + h) - (i +j)