You are on page 1of 2

J

N
T
U
W
O
R
L
D
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Code No: D0503
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
M.Tech II SEMESTER EXAMINATIONS, APRIL/MAY-2013
ADVANCED COMPILER DESIGN
(COMPUTER SCIENCE)
Time: 3hours Max.Marks:60
Answer any five questions
All questions carry equal marks
- - -

1.a) Highlight the basic principle in the design of compiler and interpreter. Compare their
performance in terms of memory requirement and speed.
b) What is the use of the symbol table in the design of compiler? What data structure is
preferred for implementation of symbol table? Give reasons for your preference.
Indicate the type of access, the various phases of the compiler have, to the symbol
table.

2. Construct LALR parser for the following grammar.
S ->S
S -> CC
C ->cC
C ->d
Describe the construction of parsing table, the steps in parsing with suitable examples.

3.a) What is "semantic analysis"? What does "semantic analysis" accomplish? What are its
side effects? What are the primary activities of a compiler's semantic analyzer?
b) Write the CFG for variable declaration statement. List the attributes of the non
terminals used and the associated syntax directed translation.

4. Explain the runtime stack and heap storage allocation. Indicate what type of
information is stored in stack and in heap. Describe the storage management in each
case.

5. How is graph coloring used in register allocation? Explain with suitable example.
Consider the following interference graph:

Assuming that there are only two registers available, show a possible register
assignment. Indicate any other assumptions made.

Contd2
R09
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net www.android.jntuworld.com
J
N
T
U
W
O
R
L
D
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
Q6
::2::

6. What are the different types of loop optimization? Explain them. Write a simple to
code to perform matrix multiplication. Convert the code to flow graph and illustrate
how the optimization techniques work on the code.

7. Write code to search for a key from the given list of numbers. With reference to this
code, answer the following questions:
i) Draw the corresponding graph of basic blocks.
ii) Identify any critical edges in the flow graph and remove them appropriately; draw
the resultant graph.
iii) Compute and draw the dominator tree of the resultant graph.
iv) For each temporary T compute LIVEUSE(T), the set of blocks containing a use of
the temporary T not preceded by an evaluation of T.
v) For each block B compute LIVEKILL(B), the set of temporaries T for which there
is an evaluation of T in B.
vi) For each temporary T compute LIVEIN(T), the set of blocks B where the
temporary T is live at the start of B.
vii) For each basic block B compute LIVEOUT(B), the set of temporaries live at the
end of block B.
viii) Compute the set GLOBAL of temporaries that are live at the start of some block.

8. What are memory regions, and why does a compiler care? What memory regions are
there, and how do they affect code generation?

*****
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net www.android.jntuworld.com

You might also like