Mail Archives: djgpp/1995/01/13/23:24:53
> DR> I also like the idea of gcc -g implying gcc -g -O0.
>
> I don't understand exactly what the advantages of this could possibly be.
> Will the program be easier to debug if it's slower? Theoretically, that
> should be the only difference optimization makes...
Optimization can obscure the relationship between the source code and machine
language instructions. As a simple example, consider a routine with two
returns. The optimizer may combine the exit code in a single location, and
as you step through the code, you suddenly jump elsewhere when you hit one of
the returns. Or, a variable may exist only in a register after optimization,
in which case looking at memory won't tell you its value.
- Raw text -