in Compiler Design retagged by
595 views
1 vote
1 vote
Consider the following code segment

a= b - c

d = a + d

a = d + e

d = c * f

d = a * d

the min number of total variables required to convert the above code segment to static single assignment form is _____________
in Compiler Design retagged by
by
595 views

2 Answers

1 vote
1 vote
For Static Single Assignment:

A0=B0-C0;

D0=A0+D1;

A2=D0+E0;

D3=C0*F0;

D4=A0*D3;

So total number of variables: A0,B0,C0,D0,D1,D2,D3,D4,E0,F0. So total 10 variables.

2 Comments

A0=B0-C0;

D0=A0+D1;  // why have u changed it to D1 ??

A2=D0+E0;

D3=C0*F0;

D4=A0*D3;

0
0
u left A2

and when u now count total variable will be 11

but when u consider 2nd expression D0 = A0 + D0 then it will be 10
0
0
0 votes
0 votes
Is ans is 11

1 comment

no the answer given is 10...i feel its 9

can u explain how u derived it?
0
0

Related questions