Difference between revisions of "Compiler Optimization"

From eLinux.org
Jump to: navigation, search
m (Bot (Edward's framework))
 
(add link to -Ox optimizations article)
Line 5: Line 5:
 
http://www.redhat.com/software/gnupro/technical/gnupro_gcc.html
 
http://www.redhat.com/software/gnupro/technical/gnupro_gcc.html
  
If you know of a good reference for what the effect of
+
Effects of optimization options are explained in [http://www.linuxjournal.com/article/7269 this LJ article].
-Os are with gcc, please put it here:
+
  
 
In the following [http://gcc.gnu.org/ml/gcc/2004-04/msg01409.html e-mail],
 
In the following [http://gcc.gnu.org/ml/gcc/2004-04/msg01409.html e-mail],

Revision as of 01:21, 7 April 2009

Here's a good overview on compiler optimizations: http://en.wikipedia.org/wiki/Compiler_optimization

Here's some info about GCC optimization techniques: http://www.redhat.com/software/gnupro/technical/gnupro_gcc.html

Effects of optimization options are explained in this LJ article.

In the following e-mail, Jim Wilson, who apparently supports gcc, writes:

From: Jim Wilson <wilson at specifixinc dot com> 
Date: Thu, 29 Apr 2004 15:58:28 -0700 
Subject: Re: optimization issue about -O2 and -Os 
------------------------------------------------------------
...
The -Os option is buggy. You might want to report a bug into our bugzilla
bug datase. See http://gcc.gnu.org/bugs.html for more info on reporting bugs.

Though the -Os option is based on the -O2 option, it is a different option, that
generates different code, and has different bugs.

Tim Riker: this is a bit overly dramtic. -Os is widely used and widely supported. The link is to a thread about general information and does not refer to any specific bug from what I can see. Try -Os out. If you have issues, try -O2 instead. In general -Os will work. Be very careful in tweaking kernel optimizations. There is kernel code that only works with the existing optimizations.