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 temporary variable required to convert the above code segment to static single assignment form is ________. Compiler Design compiler-design static-single-assignment + – Hemant Parihar asked Jan 19, 2018 edited Jan 19, 2018 by Hemant Parihar Hemant Parihar 1.1k views answer comment Share Follow See all 12 Comments See all 12 12 Comments reply Ashwin Kulkarni commented Jan 19, 2018 reply Follow Share Image is missing bro... 0 votes 0 votes Hemant Parihar commented Jan 19, 2018 reply Follow Share Added bro. 0 votes 0 votes Ashwin Kulkarni commented Jan 19, 2018 reply Follow Share 5 temporary elements. 0 votes 0 votes MiNiPanda commented Jan 19, 2018 reply Follow Share https://gateoverflow.in/192257/%23of-variables-in-ssa Same question ^ But i don't understand what is there to calculate here..the answer always comes equal to the no. Of equations right? 1 votes 1 votes Anu007 commented Jan 19, 2018 reply Follow Share c = b + a e = b dont waste register here f = c * e h = c + a i = h + f 0 votes 0 votes MiNiPanda commented Jan 19, 2018 reply Follow Share Anu Sir.. so that is allowed in SSA? Then it's okay.. something is there to evaluate:P 1 votes 1 votes Ashwin Kulkarni commented Jan 19, 2018 reply Follow Share @Anu sir that's why answer is 4 ?? This Q is asked many times and I always saw 5. Is this allowed to replace c with b+a and then only b will remain there. 1 votes 1 votes Anu007 commented Jan 19, 2018 reply Follow Share c = b + a c = b + a c = b + a c = b + c how many temporary registers are needed.? 0 votes 0 votes Hemant Parihar commented Jan 19, 2018 reply Follow Share 2 temporary variable. 0 votes 0 votes Anu007 commented Jan 19, 2018 reply Follow Share same in question 2nd equation is simply store b , which can be seen via DAG , and we can save 1 temp register. 1 votes 1 votes saxena0612 commented Jan 19, 2018 reply Follow Share @ Anu007 Agree with 4 temporary variables for this segment. But If question asks : The minimum number of temporary variable required to convert the above "part of program" to static single assignment form is : Answer would be same "4" or "5"? 0 votes 0 votes Ayan Kumar Pahari commented Feb 1, 2020 reply Follow Share It's already in SSA form. So 0 temporary variables required. 0 votes 0 votes Please log in or register to add a comment.