itsanjan / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

Enable link-time optimization (after switching to avr-gcc 4.5 or greater) #660

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
avr-gcc 4.5 has support for LTO. Enabling it would probably allow sizable 
object size reductions, especially with -Os when linking libraries spanning 
multiple compilation units.

Original issue reported on code.google.com by ca...@strayorange.com on 27 Sep 2011 at 10:38

GoogleCodeExporter commented 9 years ago
What's LTO?  

Also, we're not using avr-gcc 4.5 yet (at least, not with the Windows and Mac 
distributions).  But we might upgrade at some point (e.g. if a new WinAVR comes 
out).

Original comment by dmel...@gmail.com on 28 Sep 2011 at 12:30

GoogleCodeExporter commented 9 years ago
LTO stands for link-time optimization and basically it means deferring most 
optimizations until all compilation units (each file being compiled, including 
libraries) have been processed.
As an example, consider a library function that's called only once in the 
current program. Without LTO both caller and callee will be compiled 
separately. With LTO the callee will be inlined (it's always profitable to 
inline a function that's called only once). While just inlining might look not 
much of a win, take into consideration that this also allows code 
specialization at compile-time.
For more information, look up the -flto and -fwhole-program compile options 
(http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#Optimize-Options)

Original comment by ca...@strayorange.com on 28 Sep 2011 at 6:11

GoogleCodeExporter commented 9 years ago

Original comment by dmel...@gmail.com on 22 Oct 2011 at 10:51

GoogleCodeExporter commented 9 years ago
https://github.com/arduino/Arduino/issues/660#issuecomment-105549926

Original comment by federico...@gmail.com on 26 May 2015 at 2:46

GoogleCodeExporter commented 9 years ago

Original comment by federico...@gmail.com on 26 May 2015 at 3:24