Intermediate Code Generation: GATE CS Previous Year Questions

Intermediate Code Generation · Compiler Design

32 questions · asked in 16 of 27 years (2000–2026)

MCQ 26 · MSQ 1 · NAT 51-mark 13 · 2-mark 19

2000Questions per year2026

Questions 1–5 of 32

Q1GATE 2026 (Session 1)2 marksMCQ−0.67 if wrong
Consider the control flow graph shown in the figure.
ENTRYEXIT B1B2B3B4B5 a = b + i a = g * kf = d − fa = c * 4 t = g * kb = c + m x = g * ky = b + iz = c + m
Which one of the following options correctly lists the set of redundant expressions (common subexpressions) in the basic blocks B44 and B55?
Note: All the variables are integers.

Q2GATE 2026 (Session 2)2 marksMCQ−0.67 if wrong
Consider the control flow graph given below.
ENTRYEXIT B1B2B3B4 a = b + cd = a + ee = a + fg = d + e
Which one of the following options is the set of live variables at the exit point of each basic block?

Q3GATE 2025 (Session 1)1 markMCQ−0.33 if wrong
Which ONE of the following techniques used in compiler code optimization uses live variable analysis?

Q4GATE 2025 (Session 1)2 marksNAT
Refer to the given 3-address code sequence. This code sequence is split into basic blocks. The number of basic blocks is _________. (Answer in integer)

1001: i = 1
1002: j = 1
1003: t1 = 10*i
1004: t2 = t1+j
1005: t3 = 8*t2
1006: t4 = t3-88
1007: a[t4] = 0.0
1008: j = j+1
1009: if j <= 10 goto 1003
1010: i = i+1
1011: if i <= 10 goto 1002
1012: i = 1
1013: t5 = i-1
1014: t6 = 88*t5
1015: a[t6] = 1.0
1016: i = i+1
1017: if i <= 10 goto 1013

Q5GATE 2025 (Session 2)1 markMCQ−0.33 if wrong
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?

Keep practising

Topics in Compiler Design

All CS topics ›