Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Concept of "dead code stripping" in compiler optimization options

When i gone through my compiler(starcore,scc) optimization options, i can see one "dead code stripping".

What actually does when this option is enabled?

/Kanu

like image 969
Renjith G Avatar asked Jan 14 '11 05:01

Renjith G


People also ask

What is meant by dead code elimination in programming optimization?

Dead Code Elimination is an optimization that removes code which does not affect the program results.

What are the uses of dead code elimination in compiler design?

Dead Code Elimination : Dead code is a program snippet that is never executed or never reached in a program. It is a code that can be efficiently removed from the program without affecting any other part of the program. In case, a value is obtained and never used in the future, it is also regarded as dead code.

Which of the following is called as dead code?

In some areas of computer programming, dead code is a section in the source code of a program which is executed but whose result is never used in any other computation. The execution of dead code wastes computation time and memory.

What is the difference between dead code and unreachable code?

unreachable code is something that would never be executed because there is no flow control to reach the code. A dead code is something that gets (or might get) executed, but its results are never used.


1 Answers

The resulting executable will not include any "dead" or unreachable code, because theres no point as it can never be executed.

like image 169
mP. Avatar answered Sep 26 '22 08:09

mP.