Skip to content

GATE CS Intermediate Code Generation questions

Practise Intermediate Code Generation questions for GATE CS. Explore official PYQs and original topic-wise quizzes, check answers and view available solutions. Free, no sign-in.

Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.

11 on this page
Official PYQ2025Compiler DesignIntermediate Code GenerationNAT · 2 marks
Refer to the given 33-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 = …
Official PYQ2025Compiler DesignIntermediate Code GenerationMCQ · 1 mark
​​​​Consider the following statements about the use of backpatching in a compiler for intermediate code generation: Backpatching can be used to generate code for Boolean expression in one pass. Back[atching can be used to generate code for flow-of-control statements in one pass. Which ONE of the folloeing options is CORRECT?
Official PYQ2024Compiler DesignIntermediate Code GenerationMCQ · 2 marks
Consider the following pseudo-code. L 1: t1 = -1 L 2: t2 = 0 L 3: t3 = 0 L 4: t4 = 4 * t3 L 5: t5 = 4 * t2 L 6: t6 = t5 * M L 7: t7 = t4 + t6 L 8: t8 = a[t7] L 9: if t8 <= max goto L11 L 10: t1 = t8 L 11: t3 = t3 + 1 L 12: if t3 < M goto L4 L 13: t2 = t2 + 1 L 14: if t2 < N goto L3 L 15: max = t1 Which one of the following options CORRECTLY …
Official PYQ2021Compiler DesignIntermediate Code GenerationMCQ · 1 mark
In the context of compilers, which of the following is/are NOT\text{NOT} an intermediate representation of the source program?
Official PYQ2017Compiler DesignIntermediate Code GenerationMCQ · 1 mark
Consider the following intermediate program in three address code p = a - b q = p * c p = u * v q = p + q Which one of the following corresponds to a static single assignment form of the above code?
Official PYQ2015Compiler DesignIntermediate Code GenerationNAT · 1 mark
The least number of temporary variables required to create a three-address code in static single assignment form for the expression q+r/3+s−t∗5+u∗v/wq + r / 3 + s - t * 5 + u * v/w is__________________.
Official PYQ2015Compiler DesignIntermediate Code GenerationMCQ · 1 mark
For computer based on three-address instruction formats, each address field can be used to specify which of the following: (S1) A memory operand (S2) A processor register (S3) An implied accumulator register
Official PYQ2015Compiler DesignIntermediate Code GenerationMCQ · 1 mark
Consider the intermediate code given below. (1) i=1 (2) j=1 (3) t1 = 5 * i (4) t2 = t1 + j (5) t3 = 4 * t2 (6) t4 = t3 (7) a[t4] = -1 (8) j = j + 1 (9) if j <= 5 goto (3) (10) i = i +1 (11) if i < 5 goto (2) The number of nodes and edges in control-flow-graph constructed for the above code, respectively, are
Official PYQ2014Compiler DesignIntermediate Code GenerationMCQ · 1 mark
For a C program accessing X[i][j][k]\mathbf{X[i] [j] [k]}, the following intermediate code is generated by a compiler. Assume that the size of an integer is 3232 bits and the size of a character is 88 bits. t0 = i ∗ 1024 t1 = j ∗ 32 t2 = k ∗ 4 t3 = t1 + t0 t4 = t3 + t2 t5 = X[t4] Which one of the following statements about the source code for the C program is …
Official PYQ2014Compiler DesignIntermediate Code GenerationMCQ · 1 mark
One of the purposes of using intermediate code in compilers is to
Official PYQ1994Compiler DesignIntermediate Code GenerationMCQ · 1 mark
Generation of intermediate code based on an abstract machine model is useful in compilers because