1
GATE CSE 2015 Set 2
MCQ (Single Correct Answer)
+2
-0.6
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 the control-flow-graph constructed for the above code, respectively, are
2
GATE CSE 2014 Set 2
MCQ (Single Correct Answer)
+2
-0.6
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?3
GATE CSE 2006
MCQ (Single Correct Answer)
+2
-0.6
Consider the following C code segment.
for (i = 0; i < n; i++)
{
for (j=0; j < n; j++)
{
if (i%2)
{
x += (4*j + 5*i);
y += (7 + 4*j);
}
}
}
Which one of the following is false?4
GATE CSE 2006
MCQ (Single Correct Answer)
+2
-0.6
Consider the following translation scheme.
$$\eqalign{ & S \to ER \cr & R \to *E\left\{ {pr{\mathop{\rm int}} ('*');} \right\}R\,|\,\varepsilon \cr & E \to F + E\left\{ {pr{\mathop{\rm int}} (' + ');} \right\}\,|\,F \cr & F \to S\,|\,id\,\left\{ {pr{\mathop{\rm int}} (id.value);} \right\} \cr} $$Here id is a token that represents an integer and id.value represents the corresponding integer value. For an input '2 * 3 + 4' this translation scheme prints
Questions Asked from Code Generation and Optimization (Marks 2)
Number in Brackets after Paper Indicates No. of Questions
GATE CSE Subjects
Theory of Computation
Operating Systems
Algorithms
Database Management System
Data Structures
Computer Networks
Software Engineering
Compiler Design
Web Technologies
General Aptitude
Discrete Mathematics
Programming Languages