1 1 vote Consider the following $3$-address code sequence. This code is divided into basic blocks. How many basic blocks are there? (Answer as an integer) 1: a = 1 2: b = 2 3: if a > b goto 7 4: c = a + b 5: d = c *2 6: goto 8 7: c = a - b 8: a = c + 1 9: print a Compiler Design goclasses compiler goclasses-cs-dpp goclasses-cs-dpp-day-143 goclasses-compiler-practice-questions numerical-answers + – GO Classes 309 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
2 2 votes Rule 1: First instruction is leader: 1 Rule 2: Jump targets: goto $7 \rightarrow 7$ is leader, goto $8 \rightarrow 8$ is leader Rule 3: Instructions after jumps: after instruction 3 (conditional jump) $\rightarrow \mathbf{4}$ is leader, after instruction 6 (unconditional jump) -7 is leader (already counted)Leaders: 1, 4, 7, 8No of basic blocks = no. of leaders = 4 GO Classes answered Nov 27, 2025 GO Classes comment Share Follow 0 reply Please log in or register to add a comment.