Ye question Available Expressions Analysis ka hai.
Bass yeh dekho ki,
1. kisi basic block me jo expression calculate ho raha hai, kya woh har possible path par pehle se calculate hua tha?
2. aur uske operands beech me change nahi hue?
If yes then it is redundant (common subexpression)
They are asking B4 and B5 redundant expressions, so let's focus on them only.
B4 me g*k analyze karte hai,
Q1 - B4 ke pehle har path par calculate hua tha ?
Path 1 - B1 → B2 → B4 .........calculated in B2
Path 2 - B1 → B3 → B4 .........calculated in B3
Q2. - Kya g*k change/modify hue ? Nahi
Hence, g*k is redundant term.
B4 mai b+i bhi hai so use dekhte hai,
Q1 - available/calculated in every path ?
Path 1 - B1 → B2 → B4 ........available in B1
Path 2 - B1 → B3 → B4 .........different in B1 and B3 (B3 mai b ki value change ho gayi)
Hence, b+i not redundant.
Last, B5 mai c+m check karte hai,
Q1 - available/calculated in every path ?
Path 1 - B1 → B2 → B4 → B5 ........not available in this path
Hence, c+m is not redundant.
Hence, Ans(D) B4: {g∗k} B5:{ }