To find redundant expressions (common subexpressions) in basic blocks B4 and B5, we perform Available Expressions Analysis:
Basic Block B1:
Out(B1)={b+i}
Basic Block B2:
Does not kill b+i (neither b nor i is modified).
Out(B2)={b+i,g∗k}
Basic Block B3:
Computes: c+m, but also assigns to b (b=c+m), which kills the expression b+i.
Out(B3)={g∗k,c+m}
At the entry of Basic Block B4:
In(B4)=Out(B2)∩Out(B3)={b+i,g∗k}∩{g∗k,c+m}={g∗k} Inside B4:
The expression g∗k in x=g∗k is already available from all incoming paths ({g∗k}∈In(B4)), so **g∗k is a redundant common subexpression**.
The expression b+i in y=b+i is NOT available because it was killed along the path through B3.
Redundant expressions in **B4 = {g∗k}**.
At the entry of Basic Block B5:
B4 generates b+i, so Out(B4)={g∗k,b+i}.
In(B5)=Out(B4)={g∗k,b+i}.
Inside B5, the expression evaluated is c+m. Since c+m∈/In(B5), it is not redundant.
Redundant expressions in B5 = {}.
Thus, the correct option is (D).