69 votes 69 votes Consider the following code segment. x = u - t; y = x * v; x = y + w; y = t - z; y = x * y; The minimum number of total variables required to convert the above code segment to static single assignment form is __________. Compiler Design gatecse-2016-set1 compiler-design static-single-assignment normal numerical-answers + – Sandeep Singh asked Feb 12, 2016 • edited Feb 17, 2016 by makhdoom ghaya Sandeep Singh 27.6k views answer comment Share Follow See all 15 Comments See all 15 15 Comments reply Show 12 previous comments Manukumr commented Sep 23, 2023 reply Follow Share Can anyone give minimum variable for three address code 0 votes 0 votes Rajsukh Mohanty commented Dec 20, 2023 reply Follow Share this video can help in understanding SSA https://youtu.be/uqTT3gI7KU8 0 votes 0 votes Deepak Poonia commented Jan 20 reply Follow Share Detailed Video Solution: GATE CSE 2016 - Static Single Assignment Form SSA Question Static Single Assignment Form SSA Complete Lecture: https://www.youtube.com/watch?v=CQV8hSeMrx8 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes x1 = u - t; y1 = x1 * v; x2 = y1 + w; y2 = t - z; y3 = x2 * y2; Total 10 variables. Kuldeep Pal answered Jan 18, 2018 Kuldeep Pal comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes t1=u-t t2=t1+v t3=t2+w t4=t-z t5=t3*t4 So total number of variables required =10 {t1,t2,t3,t4,t5,u,t,v,w,z} prashantkumar734100 answered Jan 20, 2018 prashantkumar734100 comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes In SSA, each variable used must be assigned exactly once and declared before use. $u = \text{some_val;}$ $t = \text{some_val;}$ $x = u -t;$ $v = \text{some_val;}$ $y = x * v;$ $w = \text{some_val;}$ $x_2 = y + w;$ $z = \text{some_val;}$ $y_2 = t – z;$ $y_3 = x_2 * y_2;$ $\text{Total Variables required in SSA} = 10$ strawberry-jam answered Jan 28, 2023 strawberry-jam comment Share Follow See all 0 reply Please log in or register to add a comment.
–2 votes –2 votes Answer should be 3 Deepak Sharma answered Feb 13, 2016 Deepak Sharma comment Share Follow See all 0 reply Please log in or register to add a comment.