On 17/08/2011 12:08, aliko wrote:
> Thank you for explanation! The -O0 mode is usefull for me for debuging
> purposes because compiller tends to optimize out many things... In
> production I use -O2.
>

-O0 is a poor choice for most debugging, for a number of reasons.  The 
code it generates is often so long-winded it is hard to understand the 
generated assembly - there is so much extra code moving data onto and 
off from the stack that it is hard to see the real action.  The code is 
so much slower than "real" code, that timing differences become 
relevant.  Disabling optimisation disables or limits a number of the 
static error checking features that you get with gcc - you should 
compile with /lots/ of warning flags enabled.

But the biggest issue is that trying to debug or test code with -O0 
hides mistakes that become apparent when you do your real build.  Most 
of your debugging and testing effort should be with the actual code, not 
a "debug" version.  There are some types of debugging, such as stepping 
through an algorithm, that are easier if the code is not heavily 
optimised - but using -O1 will not hinder debugging and will make many 
debugging tasks much easier and much more realistic.





------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to