• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Code Generation and Optimization

Question 31

Which of the following class of statement usually produces no executable code when compiled?
  • declaration
  • assignment statements
  • input and output statements
  • structural statements

Question 32

Which of the following comparisons between static and dynamic type checking is incorrect?
  • Dynamic type checking slows down the execution
  • Dynamic type checking offers more flexibility to the programmers
  • In contrast to Static type checking, dynamic type checking may cause failure in runtime due to type errors
  • Unlike static type checking, dynamic type checking is done during compilation

Question 33

Which of the following comment about peep-hole optimization is true?
  • It is applied to small part of the code and applied repeatedly
  • It can be used to optimize intermediate code
  • It can be applied to a portion of the code that is not contiguous
  • It is applied in symbol table to optimize the memory requirements.

Question 34

In multi-programmed systems, it is advantageous if some programs such as editors and compilers can be shared by several users. Which of the following must be true of multi-programmed systems in order that a single copy of a program can be shared by several users? I. The program is a macro II. The program is recursive III. The program is reentrant
  • I only
  • II only
  • Ill only
  • I, II and III

Question 35

Consider the following C code segment:
a = b + c;
e = a + 1;
d = b + c;
f = d + 1;
g = e + f; 
In a compiler, this code segment is represented internally as a directed acyclic graph (DAG). The number of nodes in the DAG is _____________ .
  • 6
  • 12
  • 7
  • 10

Question 36

In the context of compilers, which of the following is/are NOT an intermediate representation of the source program?
  • Three address code
  • Abstract Syntax Tree (AST)
  • Control Flow Graph (CFG)
  • Symbol table

Question 37

For a statement S in a program, in the context of liveness analysis, the following sets are defined:
  • USE(S) : the set of variables used in S
  • IN(S) : the set of variables that are live at the entry of S
  • OUT(S) : the set of variables that are live at the exit of S
Consider a basic block that consists of two statements, S1 followed by S2. Which one of the following statements is correct?
  • OUT(S1) = IN (S2)
  • OUT (S1) = IN (S1) ∪ USE (S1)
  • OUT (S1) = IN (S2) ∪ OUT (S2)
  • OUT (S1) = USE (S1) ∪ IN (S2)

Question 38

Match the description of several parts of a classic optimizing compiler in List - I, with the names of those parts in List - II: \"Capture11\"

  • (1)

  • (2)

  • (3)

  • (4)

There are 38 questions to complete.

Last Updated :
Take a part in the ongoing discussion