1 1 vote i think line number 3,4,5 will make a basic block. but in the solution given line number 5 is a separate block Compiler Design + – Aakash_ 2.2k views answer comment Share Follow Print See all 10 Comments 10 10 Comments reply arya_stark commented Dec 1, 2018 reply Follow flag Conditional Statements itself a diff block. Identifying leaders in the basic block 1) 1st statement is leader. 2) Statement that is target of conditional or unconditional statement is a leader.. 3) statements that follows immediately a conditional or unconditional statement is a leader. 0 0 replyShare anjali007 commented Dec 1, 2018 reply Follow flag As statement 5 is a conditional statement it is a separate block.. 0 0 replyShare aambazinga commented Dec 1, 2018 reply Follow flag yes 5 will be in the same basic block as 3 and 4... as the target of the conditional and the statement immediately follows the conditional is in separate basic block... statement 5 falls in neither of the category. 0 0 replyShare Aakash_ commented Dec 1, 2018 reply Follow flag anjali007arya_stark rule says "statements that follows immediately a conditional or unconditional statement is a leader." statements that follows conditional statement is a leader , conditional statement itself is not a leader 0 0 replyShare anjali007 commented Dec 1, 2018 reply Follow flag @Aakash_ refe this http://home.wlu.edu/~levys/courses/cs332w2004/lectures/24_MAR_2004.pdf 0 0 replyShare Aakash_ commented Dec 1, 2018 reply Follow flag anjali007 it says the same thing, how line 5 is a basic block ? could you pls explain. 0 0 replyShare anjali007 commented Dec 1, 2018 reply Follow flag @Aakash_ Plz refer the last block that states that Leader block is the block that contains initial statement, So statement 5 is also an initial statement.. 0 0 replyShare Aakash_ commented Dec 1, 2018 reply Follow flag anjali007 Initial Statement is the first statement, not the 5th statement. i think you are confused. please check this question https://gateoverflow.in/8139/gate2015-2-29, above you said "As statement 5 is a conditional statement it is a separate block.." but this is wrong. 0 0 replyShare anjali007 commented Dec 1, 2018 reply Follow flag @Aakash_ line no 5 has conditional and then action i.e goto 7 so according to me it is the statement after the conditional which is a leader so 5 is a leader ... correct me if I am wrong 0 0 replyShare Aakash_ commented Dec 1, 2018 reply Follow flag anjali007 because of goto 7 in line#5, line 7 is a leader & next line i.e. line#6 is also a leader because it follows a conditional statement(line# 5). 0 0 replyShare Please log in or register to add a comment.