MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Some code optimizations are carried out on the intermediate code because
A
they enhance the portability of the compiler to other target processors
B
program analysis is more accurate on intermediate code than on machine code
C
the information from dataflow analysis cannot otherwise be used for optimization
D
the information from the front end cannot otherwise be used for optimization
Explanation: 

Detailed explanation-1: -Some code optimizations are carried out on the intermediate code because program analysis is more accurate on intermediate code than on machine code.

Detailed explanation-2: -Code optimization is a program modification strategy that endeavours to enhance the intermediate code, so a program utilises the least potential memory, minimises its CPU time and offers high speed.

Detailed explanation-3: -But the main purpose of doing some code-optimization on intermediate code generation is to enhance the portability of the compiler to target processors.

Detailed explanation-4: -The code optimization in the synthesis phase is a program transformation technique, which tries to improve the intermediate code by making it consume fewer resources (i.e. CPU, Memory) so that faster-running machine code will result.

There is 1 question to complete.