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 21–25 of 32

Q21GATE 2014 (Session 1)1 markMCQ−0.33 if wrong
Which one of the following is FALSE?

Q22GATE 2014 (Session 2)2 marksMCQ−0.67 if wrong
For a C program accessing x[i][j][k], the following intermediate code is generated by a compiler. Assume that the size of an integer is 32 bits and the size of a character is 8 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 CORRECT?

Q23GATE 2014 (Session 3)1 markNAT
The minimum number of arithmetic operations required to evaluate the polynomial P(x)=x5+4x3+6x+5P(x)=x^{5}+4x^{3}+6x+5 for a given value of x, using only one temporary variable is _____.

Q24GATE 2014 (Session 3)1 markMCQ−0.33 if wrong
One of the purposes of using intermediate code in compilers is to

Q25GATE 2014 (Session 3)2 marksMCQ−0.67 if wrong
Consider the basic block given below.
a= b + c
c =a + d
d =b + c
e =d - b
a =e + b
The minimum number of nodes and edges present in the DAG representation of the above basic block respectively are

Keep practising

Topics in Compiler Design

All CS topics ›