I am asked to write the reaching definition for the following code and I am wondering if my solution is correct? am I even on the right track? I truly appreciate any help or hint. Thank you.
Code:
a = 0;
while (a < 100) {
b = a + 1
c = c + b
a = b * 2
}
return c;
Step #1: finding blocks and labeling
a = 0; // block 1 | a1
while (a < 100) // block 2 |
b = a + 1 // block 3 | b2
c = c + b | c3
a = b * 2 | a3
return c; // block 3 |
Step #2: finding GEN and KILL sets for each block
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…