GATE 2025 CS (CS2) – Question 21
Consider the following statements about the use of backpatching in a compiler for intermediate code generation:
(I) Backpatching can be used to generate code for Boolean expression in one pass.
(II) Backpatching can be used to generate code for flow-of-control statements in one pass.
Which ONE of the following options is CORRECT?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (C) Both (I) and (II) are correct.
Explanation
Backpatching fills in jump targets that are unknown when the jump is emitted. It is used for one-pass code generation of both Boolean expressions and flow-of-control statements.