Directions (Q91–95): Consider the following Three Address Code sample for solving the questions:
100: t1 = y + 2 101: initial = x / t1 102: limit = 10 103: if i > j goto 105 104: goto 111 105: if num > b goto 107 106: goto 111 107: num = limit - 1 108: b = y + 2 109: i = i - num 110: goto 103 111: j = i - num 112: k = j + b
What are the various LEADERS (leading statements) for the TAC given in the passage?
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: D. 100, 103, 104, 105, 106, 107, 111
Explanation
Leaders are: the first statement (100); every jump target (103, 105, 107, 111); and every statement right after a jump (104 after 103, 105 after 104, 106 after 105, 107 after 106, 111 after 110). So 100, 103, 104, 105, 106, 107, 111.More Theory of Computation and Compilers questions
- Which of the following is the optimized version of the TAC given in the passage?
- Which of the following is the correct high level code for the TAC given in the passage?
- What blocks do Block 3 and Block 5 dominate in the flow graph for the TAC given in the passage? (Basic blocks: B1 = 100–102, B2 = 103, B3 =…
- Which of the following is the correct flow graph (adjacency matrix of basic blocks B1–B7, row → column means an edge) for the TAC given in…
- Which of the following is TRUE about the Pumping Lemma for regular languages?
- Regarding code optimization (peephole optimization), choose the correct sequence A. Algebraic Simplification B. Use of machine idioms C. Re…