The Gateway to Computer Science Excellence

+1 vote

Consider the following code segment:

The minimum number of temporary variable required to convert the above code segment to static single assignment form is ________.

+1

Given answer is 4, but i got 5.5 variables on LHS is needed.I dont think we can do any minimization here?

0

minimization can be done actually because 'e' is same as 'b'.

if we assign no variable for 'e' then it will be 4

if we assign no variable for 'e' then it will be 4

+1

I think it is 0.

As in static single assignment form a variable can be assigned only once. Here there are no repeated assignment of same variable.

As in static single assignment form a variable can be assigned only once. Here there are no repeated assignment of same variable.

+2

Please someone clear my doubt.

In SSA, we need that each variable be assigned value only once. And use temporary variables if required.

Here the given code is already in SSA. And we don't need any extra variables, or to say any "temporary" variables. So answer should be 0.

In case if it asked for** total ****numer**** of variables**, then the answer should be non-zero.

Right?

0

Yes, @Rishabh Gupta 2 .

Given 3-Address Code is Already in SSA Form, hence, we need No temp variable to convert it into SSA.

0 votes

I guess answer would be **0, **because the above code is already in Static single assignment form.

Refer to this links.

https://www.cs.cmu.edu/~fp/courses/15411-f08/lectures/09-ssa.pdf

https://www.geeksforgeeks.org/gate-gate-cs-2016-set-1-question-29/

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.4k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.3k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.1k
- Non GATE 1.4k
- Others 1.7k
- Admissions 595
- Exam Queries 576
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 17

50,654 questions

56,166 answers

193,872 comments

94,261 users