0 votes 0 votes Compiler Design compiler-design register-allocation ace-test-series + – nbhatt asked Jan 12, 2023 nbhatt 440 views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Shubhodeep commented Jan 12, 2023 reply Follow Share This is a snippet from the stanford slide You can access the slides from this link : http://openclassroom.stanford.edu/MainFolder/DocumentPage.php?course=Compilers&doc=docs/slides.html Coming back to the question The variable p is live at Basic block 1 as statement 2 uses p There is a direct path from 1→ 2 No intervening assignment to p is there Hence option D is eliminated The variable p is not live at BB 2 as there is a assignment to p in BB4 The variable p is live at Basic block 4 as statement 5 uses p There is a direct path from 4→ 5 No intervening assignment to p is there The variable p is live at Basic block 5 as statement 2 uses p There is a direct path from 5→2 No intervening assignment to p is there Hence option (C) is the answer You can also use USE(),IN(),OUT() sets, but i find this way more easy to analyse 1 votes 1 votes nbhatt commented Jan 13, 2023 reply Follow Share But ,at statement 1 there is a definition of P ,i.e there is a new definition of p from 1>2.So ,how can you say that p is live at statement 1? 0 votes 0 votes Shubhodeep commented Jan 13, 2023 reply Follow Share I hope your doubt is clear why p is live from 1→ 2 0 votes 0 votes Please log in or register to add a comment.