1,920 views
1 votes
1 votes
Consider the following code segment:

c=b+a

e=c-a

f=c*e

h=c+a

i=h+f

The minimum number of  $\color{blue} {total}$ and $\color{blue} {temporary }$ variable required to convert the above code segment to static single assignment form are  ________

8 Answers

0 votes
0 votes
p3 = p1 + p2

p4 = p3 - p2

p5 = p3 * p4

p6 = p3 + p2

p7 = p6 + p5

Therefore, total 7 temporary variables are needed.
0 votes
0 votes
4 should be ans
0 votes
0 votes

Answer should be 7.

  1. 5 For LHS of assignment statements and,
  2. 2 for (a,b) as they are not generated and directly been used.

Related questions

1 votes
1 votes
0 answers
1
Hemant Parihar asked Jan 19, 2018
1,207 views
Consider the following code segment:c = b + ae = c - af = c * eh = c + ai = h + fThe minimum number of temporary variable required to convert the above code segment to s...
1 votes
1 votes
0 answers
2
AnilGoudar asked Dec 28, 2017
408 views
Convert the following 3 address code to single Static Assignment.a = b + cd = d + a.
9 votes
9 votes
1 answer
3
papesh asked Dec 17, 2016
2,010 views
$x=5$$x=x-3$$\textbf{if } x<3$$\quad y=x*2$$\quad w=y$$\textbf{else}$$\quad y=x-3$$w=x-y$$z=x+y$Give Equivalent SSA.