Question: Consider the following code: 1: READ(x); 2: READ(y); LI 3: if (x 9) goto L4 4: if (y3) goto L2 x=3+x; b=y+x; goto L3 y=3+x;

 Consider the following code: 1: READ(x); 2: READ(y); LI 3: if

Consider the following code: 1: READ(x); 2: READ(y); LI 3: if (x 9) goto L4 4: if (y3) goto L2 x=3+x; b=y+x; goto L3 y=3+x; 2 8: 9: L310: y=x+y; 11 goto L1; 12: 13: halt L4 WRITE (b) 1. Draw the CFG for this piece of code. 2. Show the results of running a reaching definitions analysis on this code. For each line of code, show what definitions reach that line. Assume this is the only code in the program 3. Show the results of running a liveness analysis on this code. For each line of code show what variables are live out for that line (i.e., what variables are live immediately after that line would execute)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!