天天

avr studio optimization

0
阅读(12729)

The current levels of optimization are:

-O0 No optimization. This is the same as not specifying any optimization.
-01 Optimize. Reduces code size and execution time without performing any optimizations that take a great
deal of compilation time.
-O2 Optimize even more. avr-gcc performs almost all optimizations that don't involve a space-time tradeoff.
-O3 Optimize yet more. This level performs all optimizations at -O2 along with -finline-functions and -
frename-registers.
-Os Optimize for size. Enables all -O2 optimizations that don't increase code size. It also performs
further optimizations designed to reduce code size.
 
今天看了一下,竟然工程用的是-Os,难刚开始定义变量的时候就出错了,一直以为新建工程的优化等级是-O0 ,
所有这些优化等级,-Os的优化最严重,对于48v来讲的话,选-O0 大小为总容量的130%几,选-O1 的话为120%
选-O2 的话为100%,选-O3 的话为110%,而选-Os 的话为90%,看来得好好‘优化’下了!