Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Optimizer bugs are usually a rare occurrence. However, if an optimizer bug does occur, tracking one down can be difficult. If an optimizer bug is suspected, then the first thing to do is to disable optimization for the entire program and try again. If the bug goes away, then an optimizer bug may be at fault; otherwise the bug is most likely due to a coding error.
If the problem disappeared with optimization off, the next step is to determine which file is causing the bug. If a debugger shows that the fault is in a particular routine, it is often best to start by turning off optimization on just the file that contains that routine. If the issue goes away, then some code within that file contains the problem.