GATE / CS ARCHIVE

GATE CSE 2014 SET 2 / QUESTION 18

GATE CSE 2014 Set 2 Q18

Compiler Design · Compiler Phases, Linking & Loading · Full GATE CSE 2014 Set 2 paper

GATE 2014 Set 2, Q18 1 mark · MCQ
Report issue

Compiler Phases, Linking & Loading

Question 18, GATE 2014: Which is not performed during compilation of a program? A dynamic memory allocation; B type checking; C symbol-table management; D inline expansion.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Set up the reasoning. Distinguish work done on the source representation by a compiler from operations performed by the compiled program when it runs. A dynamic allocation creates runtime objects whose sizes or lifetimes may depend on execution.

2. Derive the result. Allocation of the running program’s dynamic objects occurs at runtime. Type checking, symbol-table construction and inline expansion are compiler tasks. Thus A. A compiler may itself allocate memory while running, but that is not the intended meaning of program dynamic allocation.

3. Check the interpretation. The compiler may emit allocation calls and itself allocate memory while compiling; those facts do not make allocation of the target program's runtime objects a compilation phase. Type checks, names, and inlining are standard compile-time concerns.

Original paper, page 33 · Answer key