This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[wwwdocs] Mention function reordering
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org, iains at gcc dot gnu dot org, gerald at pfeifer dot com
- Date: Fri, 7 Jan 2011 19:03:16 +0100
- Subject: [wwwdocs] Mention function reordering
Hi,
this patch mention function reordering. We probably should test if darwin
implementation is working and add Apple LD into list of well behaving linkers.
Honza
Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.6/changes.html,v
retrieving revision 1.73
diff -u -r1.73 changes.html
--- changes.html 27 Nov 2010 10:26:28 -0000 1.73
+++ changes.html 7 Jan 2011 17:59:35 -0000
@@ -65,7 +65,7 @@
now split itself into multiple parallel compilations. Parallelism
is controlled with <code>-flto=<em>n</em></code> (where
<em>n</em> specifies the number of compilations to execute in
- parallel. GCC can also cooperate with a GNU make job server
+ parallel). GCC can also cooperate with a GNU make job server
by specifying the <code>-flto=jobserver</code> option and
adding <code>+</code> to the beginning of the
Makefile rule executing the linker.</li>
@@ -136,6 +136,19 @@
Unlikely executed functions are optimized for size. Functions
executed once are optimized for size except for the inner
loops.</li>
+ <li>On most targets with named section support the functions used only
+ at startup (static constructors and <code>main</code>), functions used
+ only at exit and functions detected to be cold are placed into separate
+ text segment subsections.
+ This extends <code>-freorder-functions</code> feature and is
+ controlled by the same switch. The goal is to improve startup time of large
+ C++ programs.
+ <p>Proper function placement require linker support.
+ GNU ld 2.21.51 on ELF targets was updated to place
+ those functions together within the text section leading to better code
+ locality and faster startup times of large C++ programs. Support in gold
+ linker is planned.</p>
+ </li>
</ul>
</li>
<li>A new switch <code>-fstack-usage</code> has been added. It makes