Forum Discussion
Altera_Forum
Honored Contributor
14 years ago --- Quote Start --- We design fault-tolerant vital systems, so we have code that really "should" never be reached, but in the event of a single-point hardware failure (e.g. a stuck bit) we need the system to take appropriate action. Hence the "dead code". --- Quote End --- But compiler "dead code" - code which it removes is code it determined cannot and will not be executed. In a completely obvious example
if(1)
do_something();
else
do_something_else();
The compiler will delete the else - it knows it can't get there no matter what you do or fault you have in your program. Maybe if you cite an example it will help us to understand what you mean by "dead code". I would think if the compiler removes dead code that really isn't dead, then the compiler is faulty and I'd be worried about using that in a fault-tolerant system, wouldn't you? Bill