This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [texi, LTO]: Mention that -flto and -fwhole-program can be used simultaneously


On 10/05/2009 07:44 PM, Diego Novillo wrote:
> I would rather mention in the -flto entry that -flto does not imply
> -fwhole-program.  Something along the lines of "link time
> optimizations do not require the presence of the whole program to
> operate.  If the application does not have any runtime dependencies,
> such as shared libraries or dynamically loaded modules, it should be
> possible to combine -flto with -fwhole-program to allow the
> interprocedural optimizers to use more aggressive assumptions, which
> may lead to improved optimization opportunities."
>   

I copied the text but spared the "such as shared libraries or
dynamically loaded modules". As I think it is misleading: In my
understanding -fwhole-program causes no problem if one calls functions
in dynamically linked libraries. The problem is only if one calls from a
library a function in the -fwhole-program-optimized program (which is
implicitly marked as "static" in the C sense).

Is the updated patch OK?

Tobias
2009-10-06  Tobias Burnus  <burnus@net-b.de>

	* doc/invoke.texi (-flto,-fwhole-program): Make clear that the
	-flto and -fwhole-program flags can be combined.

Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi	(revision 152471)
+++ gcc/doc/invoke.texi	(working copy)
@@ -7105,9 +7105,9 @@
 and in effect are optimized more aggressively by interprocedural optimizers.
 While this option is equivalent to proper use of the @code{static} keyword for
 programs consisting of a single file, in combination with option
-@option{--combine} this flag can be used to compile many smaller scale C
-programs since the functions and variables become local for the whole combined
-compilation unit, not for the single source file itself.
+@option{-combine} or @option{-flto} this flag can be used to compile many
+smaller scale programs since the functions and variables become local for the
+whole combined compilation unit, not for the single source file itself.
 
 This option implies @option{-fwhole-file} for Fortran programs.
 
@@ -7245,6 +7245,13 @@
 will be extracted and linked as usual, but they will not participate
 in the LTO optimization process.
 
+Link time optimizations do not require the presence of the whole
+program to operate.  If the application does not have any runtime
+dependencies, it should be possible to combine @option{-flto} with
+@option{-fwhole-program} to allow the interprocedural optimizers to
+use more aggressive assumptions, which may lead to improved
+optimization opportunities. 
+
 Regarding portability: the current implementation of LTO makes no
 attempt at generating bytecode that can be ported between different
 types of hosts.  The bytecode files are versioned and there is a

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]