------- Comment #20 from m dot reszat at kostal dot com  2009-01-15 11:15 
-------
There's a couple of things worth mentioning, based on the documentation. Quote:
`-finline-small-functions'
     Integrate functions into their callers when their body is smaller
     than expected function call code (so overall size of program gets
     smaller).  The compiler heuristically decides which functions are
     simple enough to be worth integrating in this way.

     Enabled at level `-O2'.

`-Os'
     Optimize for size.  `-Os' enables all `-O2' optimizations that do
     not typically increase code size.  It also performs further
     optimizations designed to reduce code size.

     `-Os' disables the following optimization flags:
          -falign-functions  -falign-jumps  -falign-loops
          -falign-labels  -freorder-blocks  -freorder-blocks-and-partition
          -fprefetch-loop-arrays  -ftree-vect-loop-version


A) Starting with 4.3, -O2 enables -finline-small-functions (which has not been
in <4.3), and -Os does not disable it (assuming it works as intented).

B) The documentation does not clearly state -finline-small-functions is enabled
for -Os, as all other sub-optimizations explicitly list -Os if applicable.

C) For my powerpc target, code size increased dramatically for some modules.
This is because even void/void functions become inlined.

D) Using -Os -fno-inline-small-functions, overall code size is significantly
smaller compared to <4.3.

I presume more targets are affected. Following your discussion, the backends
are not easily fixed. Would it make sense to add -finline-small-functions to
the options disabled by -Os?


-- 

m dot reszat at kostal dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |m dot reszat at kostal dot
                   |                            |com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30908

Reply via email to