Intermediate Code questions

Q47

GATE CS 2015 CS-1Intermediate CodeNAT2 marks
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 ________.
Show answer without attempting

Answer: 8

Q28

GATE CS 2015 CS-2Intermediate CodeMCQ1 mark−1/3 if wrong
In the context of abstract-syntax-tree (AST) and control-flow-graph (CFG), which one of the following is TRUE?
Show answer without attempting

Answer: C

Q44

GATE CS 2015 CS-2Intermediate CodeMCQ2 marks−2/3 if wrong
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
Show answer without attempting

Answer: B

0/30 correct0 marks

Related topics in Compiler Design