Code Generation
1.

Code generation can be considered as the?

A.  

first phase of compilation

B.  

second phase of compilation

C.  

third phase of compilation

D.  

final phase of compilation

2.

 ___________ is a tool that depicts the structure of basic blocks, helps to see the flow of values flowing among the basic blocks, and offers optimization too.

A.  

DAG

B.  

CAG

C.  

SAG

D.  

PAG

3.

n Directed Acyclic Graph, Leaf nodes represent?

A.  

identifiers

B.  

names 

C.  

constants

D.  

All of the above

4.

n Algebraic expression simplification, a = a + 1 can simply be replaced by?

A.  

a

B.  

INC a

C.  

DEC a

D.  

MUL a

5.

x * 2 can be replaced by x << 1 is an example of?

A.  

Algebraic expression simplification

B.  

Accessing machine instructions

C.  

Strength reduction

D.  

Code Generator

6.

 The following code is an example of?

void add_ten(int x)
{
   return x + 10;
   printf(""value of x is %d"", x);
}
A.  

Redundant instruction elimination

B.  

Unreachable code

C.  

Flow of control optimization

D.  

None of the above

7.

How many descriptors are used for track both the registers (for availability) and addresses (location of values) while generating the code?

A.  

2

B.  

3

C.  

4

D.  

5

8.

__________ are used to keep track of memory locations where the values of identifiers are stored.

A.  

Register descriptor

B.  

Address descriptor

C.  

Both A and B

D.  

None of the above

9.

Code generator uses ______ function to determine the status of available registers and the location of name values.

A.  

setReg

B.  

cinReg

C.  

pfReg

D.  

getReg

10.

Which of the following is not a form of Intermediate representation?

A.  

Abstract Syntax Tree

B.  

3-address code

C.  

Directed cyclic Graph

D.  

Reverse Polish Notation