Question: COMPILER CONSTRUCTION Control Flow and Liveness Analysis. The following fragment of 3-address code was produced by a nonoptimizing compiler 1 start: sum0 2 3 test

COMPILER CONSTRUCTION

COMPILER CONSTRUCTION Control Flow and Liveness Analysis. The following fragment of 3-address

Control Flow and Liveness Analysis. The following fragment of 3-address code was produced by a nonoptimizing compiler 1 start: sum0 2 3 test 4 switch: goto disp 5 case 1: sum=sum + 1 6 7 case2 : t1=1 8 9 if i> n goto end1 goto end2 10 11 case3: t1-sum 12 13 14 15 default:sum - sum +1 16 17 18 disp: if i 5 goto case1 19 20 21 22 end2: 1 1 + 1 23 24 end1 sum-sum + t2 t2-t1 + 2 sum = t2 goto end2 goto end2 goto end2 if i -- 8 goto case2 if i 13 goto case3 goto default goto test print sum Assume that there are no entry points into the code from outside other than at start (a) (20% credit) Decompose the code into basic blocks Bi,B2, . . . , giving a range of line numbers for each

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!