6 votes 6 votes Consider the expression $a + -b*c +d/e.$ The minimum number of temporary variables required to create a three-address code for this expression in Static Single Assignment form is ____________ Compiler Design go2025-mockgate-1 numerical-answers intermediate-code static-single-assignment compiler-design + – gatecse asked Jan 3, 2021 • edited Jan 4, 2021 by Lakshman Bhaiya gatecse 805 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 15 votes 15 votes $t_1 = -b;$ $t_2 = t_1*c;$ $t_3 = d/e;$ $t_4 = a+t_1;$ $t_5 = t_4+t_3;$ So, $5$ temporary variables needed. The first expression is having the unary operator $"-".$ Reference: http://www.cs.ecu.edu/karl/5220/spr16/Notes/Codegen/intermediate.html gatecse answered Jan 3, 2021 • edited Dec 31, 2021 by Arjun 1 flag: ✌ Edit necessary (Deepak Poonia “t4 = a + t2”) gatecse comment Share Follow See all 13 Comments See all 13 13 Comments reply Show 10 previous comments amitarp818 commented Dec 27, 2023 reply Follow Share why t4 = a +t1 shouldn’t it be just t4= a+t2 as t1 is being considered twice??@gatecse @Deepak Poonia @Sachin Mittal 1 0 votes 0 votes Deepak Poonia commented Jan 19 i edited by Deepak Poonia Jan 20 reply Follow Share @amitarp818, Yes. It should be $t_4 = a + t_2.$Detailed Video Solution: Static Single Assignment Form SSA Question Static Single Assignment Form SSA Complete Lecture: https://www.youtube.com/watch?v=CQV8hSeMrx8 2 votes 2 votes Jagadish_yedla commented Jan 23 reply Follow Share @DebRC the question has asked about how many total variables required but not about temporary variables. so assigned unique temporary variable for each variable But here asked minimum number of temporary variables 0 votes 0 votes Please log in or register to add a comment.