Runtime Environment


Question 1
Consider the control flow graph shown.

Which one of the following choices correctly lists the set of live variables at the exit point of each basic block?
A
B1: {}, B2: {a}, B3: {a}, B4: {a}
B
B1: {i, j}, B2: {a}, B3: {a}, B4: {i}
C
B1: {a, i, j}, B2: {a, i, j}, B3: {a, i}, B4: {a}
D
B1: {a, i, j}, B2: {a, j}, B3: {a, j}, B4: {a, i, j}
GATE CSE 2023   Compiler Design
Question 2
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?
A
OUT(S1) = IN (S2)
B
OUT (S1) = IN (S1) \cup USE (S1)
C
OUT (S1) =IN (S2) \cup OUT (S2)
D
OUT (S1) = USE (S1)\cup IN (S2)
GATE CSE 2021 SET-2   Compiler Design


Question 3
Consider the following statements.

S1: The sequence of procedure calls corresponds to a preorder traversal of the activation tree.
S2: The sequence of procedure returns corresponds to a postorder traversal of the activation tree.

Which one of the following options is correct?
A
S1 is true and S2 is false
B
S1 is false and S2 is true
C
S1 is true and S2 is true
D
S1 is false and S2 is false
GATE CSE 2021 SET-1   Compiler Design
Question 4
Which of the following comparisons between static and dynamic type checking incorrect?
A
Dynamic type checking slows down the execution
B
Dynamic type checking offers more flexibility to the programmers
C
In contrast to Static type checking, dynamic type checking may cause failure in runtime due to type errors
D
Unlike static type checking dynamic type checking is done during compilation
ISRO CSE 2018   Compiler Design
Question 5
simple two-pass assembler does which of the following in the first pass:
A
Checks to see if the instructions are legal in the current assembly mode
B
It allocates space for the literals.
C
It builds the symbol table for the symbols and their values.
D
All of these
ISRO CSE 2016   Compiler Design


There are 5 questions to complete.

3 thoughts on “Runtime Environment”

Leave a Comment